add webhook endpoint
This commit is contained in:
		
							
								
								
									
										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 webhook from "./api/webhook.ts"; | ||||
|  | ||||
| export const routeList = [ | ||||
| 	echo, | ||||
| 	webhook, | ||||
| ]; | ||||
|  | ||||
| export type RouteList = typeof routeList; | ||||
		Reference in New Issue
	
	Block a user
	 dylan
					dylan