Update code.ts
This commit is contained in:
parent
af4ecf3b69
commit
ca5daf7476
15
code.ts
15
code.ts
|
|
@ -27,21 +27,6 @@ const server = serve({
|
||||||
return new Response(`DB is no more`)
|
return new Response(`DB is no more`)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"/gitea/webhook": {
|
|
||||||
POST: async (req) => {
|
|
||||||
const payload = await req.json()
|
|
||||||
const eventType = req.headers.get("X-Gitea-Event") || "unknown"
|
|
||||||
console.log(`🌵 Received Gitea webhook ${eventType}`)
|
|
||||||
|
|
||||||
try {
|
|
||||||
await handleGiteaWebhook(payload, eventType as any)
|
|
||||||
return new Response("OK", { status: 200 })
|
|
||||||
} catch (error) {
|
|
||||||
const errorLog: ErrorLog = {
|
|
||||||
timestamp: new Date().toISOString(),
|
|
||||||
message: error instanceof Error ? error.message : String(error),
|
|
||||||
stack: error instanceof Error ? error.stack : undefined,
|
|
||||||
payload,
|
|
||||||
}
|
}
|
||||||
errors.push(errorLog)
|
errors.push(errorLog)
|
||||||
console.error("💥 Webhook error 💥")
|
console.error("💥 Webhook error 💥")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user