diff --git a/src/app.ts b/src/app.ts index 01381ac..62a10ec 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,4 +1,4 @@ -import { type Context, cors, type Handler, Hono, type HonoEnv, type MiddlewareHandler } from '@/deps.ts'; +import { type Context, cors, type Handler, Hono, type HonoEnv, logger, type MiddlewareHandler } from '@/deps.ts'; import { accountController, @@ -29,7 +29,7 @@ type AppController = Handler; const app = new Hono(); -app.use('/*', cors({ origin: '*', exposeHeaders: ['link'] }), setAuth); +app.use('/*', logger(), cors({ origin: '*', exposeHeaders: ['link'] }), setAuth); app.get('/api/v1/instance', instanceController); diff --git a/src/deps.ts b/src/deps.ts index 571303d..af1965b 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -7,7 +7,7 @@ export { validator, } from 'https://deno.land/x/hono@v3.0.2/mod.ts'; export { HTTPException } from 'https://deno.land/x/hono@v3.0.2/http-exception.ts'; -export { cors } from 'https://deno.land/x/hono@v3.0.2/middleware.ts'; +export { cors, logger } from 'https://deno.land/x/hono@v3.0.2/middleware.ts'; export { z } from 'https://deno.land/x/zod@v3.20.5/mod.ts'; export { Author, RelayPool } from 'https://dev.jspm.io/nostr-relaypool@0.5.3'; export {