Add logger middleware
This commit is contained in:
parent
cb8e78ab59
commit
d7805ae65b
|
@ -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 {
|
import {
|
||||||
accountController,
|
accountController,
|
||||||
|
@ -29,7 +29,7 @@ type AppController = Handler<AppEnv>;
|
||||||
|
|
||||||
const app = new Hono<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);
|
app.get('/api/v1/instance', instanceController);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ export {
|
||||||
validator,
|
validator,
|
||||||
} from 'https://deno.land/x/hono@v3.0.2/mod.ts';
|
} 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 { 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 { 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 { Author, RelayPool } from 'https://dev.jspm.io/nostr-relaypool@0.5.3';
|
||||||
export {
|
export {
|
||||||
|
|
Loading…
Reference in New Issue