Add logger middleware

This commit is contained in:
Alex Gleason 2023-04-30 15:16:33 -05:00
parent cb8e78ab59
commit d7805ae65b
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 3 additions and 3 deletions

View File

@ -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<AppEnv>;
const app = new Hono<AppEnv>();
app.use('/*', cors({ origin: '*', exposeHeaders: ['link'] }), setAuth);
app.use('/*', logger(), cors({ origin: '*', exposeHeaders: ['link'] }), setAuth);
app.get('/api/v1/instance', instanceController);

View File

@ -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 {