parent
d394724200
commit
bfce5806c2
1 changed files with 2 additions and 2 deletions
|
@ -56,9 +56,9 @@ Here is an example of logger middleware with each of the different functions:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
app.use(async (ctx, next) => {
|
app.use(async (ctx, next) => {
|
||||||
const start = new Date();
|
const start = Date.now();
|
||||||
await next();
|
await next();
|
||||||
const ms = new Date() - start;
|
const ms = Date.now() - start;
|
||||||
console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
|
console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue