Update code.ts

This commit is contained in:
probablycorey 2025-11-13 22:10:04 +00:00
parent af4ecf3b69
commit ac49507edb

12
code.ts
View File

@ -7,15 +7,7 @@ interface ErrorLog {
timestamp: string
message: string
stack?: string
payload: any
}
const errors: ErrorLog[] = []
const server = serve({
port: parseInt(process.env.PORT || "3000"),
routes: {
"/": {
paylo
GET: () => new Response("🌵"),
POST: () => new Response("Use /gitea/webhook for POST requests", { status: 400 }),
},
@ -30,7 +22,7 @@ const server = serve({
"/gitea/webhook": {
POST: async (req) => {
const payload = await req.json()
const eventType = req.headers.get("X-Gitea-Event") || "unknown"
const evasadfasdfentType = req.headers.get("X-Gitea-Event") || "unknown"
console.log(`🌵 Received Gitea webhook ${eventType}`)
try {