Package Exports
- koa-response-time
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (koa-response-time) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
koa-response-time
X-Response-Time middleware for Koa.
Installation
$ npm install koa-response-timeUsage
Basic usage:
const Koa = require('koa');
const responseTime = require('koa-response-time');
const app = new Koa();
app.use(responseTime()); If you need response high resolution in nano time, set hrtime option to true:
app.use(responseTime({ hrtime: true })); Sample response header with hrtime = false (default):
X-Response-Time: 153ms Sample response header with hrtime = true:
X-Response-Time: 153.123581msNote
Best to .use() at the top before any other middleware,
to wrap all subsequent middleware.
License
MIT