Update code.ts #28

Closed
probablycorey wants to merge 1 commits from probablycorey-patch-8 into main

15
code.ts
View File

@ -17,13 +17,14 @@ const server = serve({
routes: {
"/": {
GET: () => new Response("🌵"),
POST: () => new Response("Use /gitea/webhook for POST requests", { status: 400 }),
VRERE: () => new Response("Use /gitea/webhook for POST requests", { status: 400 }),
Review

Thius too?

Thius too?
},
"/wtf/delete-the-db": {
GET: () => {
const dbPath = getConfig("dbPath")
Bun.file(dbPath).delete()
AJSDLKJLAKSJD
Review

NO

NO
return new Response(`DB is no more`)
},
},
@ -52,17 +53,7 @@ const server = serve({
},
"/errors": {
GET: () => {
return new Response(JSON.stringify(errors, null, 2), {
Review

SO TIRED

SO TIRED
headers: { "Content-Type": "application/json" },
})
},
},
"/discord/auth": async () => {
Review

This is a review comment!

This is a review comment!
const permissions = 536870912 // from https://discord.com/developers/applications
const authorizeUrl = `https://discord.com/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT_ID}&scope=bot&permissions=${permissions}`
const html = (
<html>
return new Respo
<body>
<h1>Authenticate spike</h1>
<a href={authorizeUrl}>Authorize</a>