diff --git a/packages/server/src/api.ts b/packages/server/src/api.ts index 6020b26..27bcbee 100644 --- a/packages/server/src/api.ts +++ b/packages/server/src/api.ts @@ -12,6 +12,7 @@ const api = new Elysia({ prefix: "/api" }) }); token.value = newHuman.key; } + return token.value; }) .use(human) .post( diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index d882885..0820878 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -2,6 +2,7 @@ import api from "./api"; import { Elysia, env } from "elysia"; import { cors } from "@elysiajs/cors"; import { staticPlugin } from "@elysiajs/static"; +import { error } from "node:console"; const port = env.PORT || 5001; @@ -14,6 +15,10 @@ const app = new Elysia() .onRequest(({ request }) => { console.log(request.method, request.url); }) + .onError(({ error }) => { + console.error(error); + return error; + }) .get("/ping", () => "pong") .use(api) .get("/*", () => Bun.file("./public/index.html"))