add webhook endpoint

This commit is contained in:
dylan 2023-10-29 17:54:20 -07:00
parent cfdfb449f0
commit c55a9e8b98
2 changed files with 21 additions and 0 deletions

19
src/server/api/webhook.ts Normal file
View File

@ -0,0 +1,19 @@
import { Type } from "@sinclair/typebox";
import { FirRouteInput, FirRouteOptions } from "../util/routewrap.js";
const method = "POST";
const url = "/api/webhook-gh";
const payloadT = Type.Any();
const handler = ({payload}: FirRouteInput<typeof payloadT>) => {
console.log(payload);
return {};
};
export default {
method,
url,
payloadT,
handler,
} as const satisfies FirRouteOptions<typeof payloadT>;

View File

@ -1,7 +1,9 @@
import echo from "./api/echo.ts"; import echo from "./api/echo.ts";
import webhook from "./api/webhook.ts";
export const routeList = [ export const routeList = [
echo, echo,
webhook,
]; ];
export type RouteList = typeof routeList; export type RouteList = typeof routeList;