better logging

This commit is contained in:
2025-08-17 22:26:41 -04:00
parent e30adf8d82
commit f5de37523a
2 changed files with 6 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ const api = new Elysia({ prefix: "/api" })
});
token.value = newHuman.key;
}
return token.value;
})
.use(human)
.post(

View File

@@ -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"))