koa-rt

X-Repsonse-Time middleware for koa with microtime

npm install koa-rt
36 downloads in the last week
145 downloads in the last month

koa-rt

koa rt with microtime

NPM

Usage

var koa = require('koa');
var rt = require('koa-rt');
var app = koa();

app.use(rt());

app.use(function *(next){
  yield sleep(150);
  this.body = 'Hello';
});

function sleep(ms) {
  return function(done){
    setTimeout(done, ms);
  };
}

app.listen(7001);

console.log('listening on port 7001');

License

MIT

npm loves you