Skip to content

Commit b5761d0

Browse files
Merge pull request #1579 from notiv-nt/patch-1
docs(middleware): update logger middleware code example
2 parents 254335d + 3721ef0 commit b5761d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/middlewares.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ You implement custom Nest middleware in either a function, or in a class with an
2323
```typescript
2424
@@filename(logger.middleware)
2525
import { Injectable, NestMiddleware } from '@nestjs/common';
26-
import { Request, Response } from 'express';
26+
import { Request, Response, NextFunction } from 'express';
2727

2828
@Injectable()
2929
export class LoggerMiddleware implements NestMiddleware {
30-
use(req: Request, res: Response, next: Function) {
30+
use(req: Request, res: Response, next: NextFunction) {
3131
console.log('Request...');
3232
next();
3333
}
@@ -200,9 +200,9 @@ The `LoggerMiddleware` class we've been using is quite simple. It has no members
200200

201201
```typescript
202202
@@filename(logger.middleware)
203-
import { Request, Response } from 'express';
203+
import { Request, Response, NextFunction } from 'express';
204204

205-
export function logger(req: Request, res: Response, next: Function) {
205+
export function logger(req: Request, res: Response, next: NextFunction) {
206206
console.log(`Request...`);
207207
next();
208208
};

0 commit comments

Comments
 (0)