File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -277,27 +277,20 @@ See the [pino-http README](https://npm.im/pino-http) for more info.
277277npm install pino pino-http hono
278278```
279279
280- ``` ts
281- import { HttpBindings , serve } from ' @hono/node-server' ;
280+ ``` js
281+ import { serve } from ' @hono/node-server' ;
282282import { Hono } from ' hono' ;
283283import { requestId } from ' hono/request-id' ;
284- import { pino } from ' pino' ;
285284import { pinoHttp } from ' pino-http' ;
286285
287- declare module ' hono' {
288- interface ContextVariableMap {
289- logger: pino .Logger ;
290- }
291- }
292-
293- const app = new Hono <{ Bindings: HttpBindings }>();
286+ const app = new Hono ();
294287app .use (requestId ());
295288app .use (async (c , next ) => {
296289 // pass hono's request-id to pino-http
297290 c .env .incoming .id = c .var .requestId ;
298291
299292 // map express style middleware to hono
300- await new Promise < void > ((resolve ) => pinoHttp ()(c .env .incoming , c .env .outgoing , () => resolve ()));
293+ await new Promise ((resolve ) => pinoHttp ()(c .env .incoming , c .env .outgoing , () => resolve ()));
301294
302295 c .set (' logger' , c .env .incoming .log );
303296
You can’t perform that action at this time.
0 commit comments