feat: migrate from Elysia Eden to Contract-First API (OpenAPI)

This commit is contained in:
bipproduction
2026-02-07 18:12:52 +08:00
parent 6abd32650d
commit f0c317837f
10 changed files with 1855 additions and 36 deletions

View File

@@ -86,6 +86,11 @@ export function apiMiddleware(app: Elysia) {
}
})
.onBeforeHandle(({ user, set, request }) => {
const url = new URL(request.url);
if (url.pathname.startsWith("/api/docs")) {
return;
}
if (!user) {
logger.warn(`[AUTH] Unauthorized: ${request.method} ${request.url}`);
set.status = 401;