add webhook endpoint
This commit is contained in:
parent
cfdfb449f0
commit
c55a9e8b98
19
src/server/api/webhook.ts
Normal file
19
src/server/api/webhook.ts
Normal 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>;
|
@ -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;
|
Loading…
x
Reference in New Issue
Block a user