koa-response-time
X-Response-Time middleware for Koa.
Installation
$ npm install koa-response-time
Usage
Basic usage:
const Koa = ;const responseTime = ;const app = ; app;
If you need response high resolution in nano time, set hrtime
option to true
:
app;
Sample response header with hrtime = false
(default):
X-Response-Time: 153ms
Sample response header with hrtime = true
:
X-Response-Time: 153.123581ms
Note
Best to .use()
at the top before any other middleware,
to wrap all subsequent middleware.
License
MIT