Refactor middleware and routes to use onRequest for API key and admin key guards; update dependencies and improve logging for error handling

This commit is contained in:
Flavio Fois
2026-03-02 19:30:59 +01:00
parent 5761cbaa55
commit 3f15edae75
8 changed files with 72 additions and 58 deletions

View File

@@ -38,6 +38,7 @@ const app = new Elysia()
})
.onError(({ error, set, code }) => {
console.error("Error processing request:", error);
console.log(code)
if (code === "NOT_FOUND") {
set.status = 404;
return { success: false, message: "Not found" };