Compare commits
1 Commits
main
...
probablyco
| Author | SHA1 | Date | |
|---|---|---|---|
| ac49507edb |
12
code.ts
12
code.ts
|
|
@ -7,15 +7,7 @@ interface ErrorLog {
|
||||||
timestamp: string
|
timestamp: string
|
||||||
message: string
|
message: string
|
||||||
stack?: string
|
stack?: string
|
||||||
payload: any
|
paylo
|
||||||
}
|
|
||||||
|
|
||||||
const errors: ErrorLog[] = []
|
|
||||||
|
|
||||||
const server = serve({
|
|
||||||
port: parseInt(process.env.PORT || "3000"),
|
|
||||||
routes: {
|
|
||||||
"/": {
|
|
||||||
GET: () => new Response("🌵"),
|
GET: () => new Response("🌵"),
|
||||||
POST: () => new Response("Use /gitea/webhook for POST requests", { status: 400 }),
|
POST: () => new Response("Use /gitea/webhook for POST requests", { status: 400 }),
|
||||||
},
|
},
|
||||||
|
|
@ -30,7 +22,7 @@ const server = serve({
|
||||||
"/gitea/webhook": {
|
"/gitea/webhook": {
|
||||||
POST: async (req) => {
|
POST: async (req) => {
|
||||||
const payload = await req.json()
|
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}`)
|
console.log(`🌵 Received Gitea webhook ${eventType}`)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user