diff --git a/src/index.ts b/src/index.ts index 7313c61..7769f99 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,14 @@ import token from "./routes/token"; +import config from "./routes/config"; Bun.serve({ port: 3000, async fetch(req) { const url = new URL(req.url); - console.log(`${new Date()} ${req.method} ${url.pathname}`); + console.log(`${new Date().toUTCString()} ${req.method} ${url.pathname}`); - if (url.pathname === "/") return new Response("hello yes this is garf"); + if (url.pathname === "/") return await config(req); if (url.pathname === "/token") return await token(req); return new Response("garf dont know what want..."); }, diff --git a/src/routes/config.ts b/src/routes/config.ts new file mode 100644 index 0000000..b3c517e --- /dev/null +++ b/src/routes/config.ts @@ -0,0 +1,8 @@ +export default async function (req: Request): Promise { + return new Response( + JSON.stringify({ + DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID, + }), + { headers: { "Content-Type": "application/json" } } + ); +}