koa-rt
X-Repsonse-Time middleware for koa with microtime
Last updated 3 years ago by dead_horse .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install koa-rt 
SYNC missed versions from official npm registry.

koa-rt

Build Status

koa rt. can be custom with microtime.

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

Current Tags

  • 1.0.0                                ...           latest (3 years ago)

3 Versions

  • 1.0.0                                ...           3 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 2
This Week 97
This Month 342
Last Day 14
Last Week 122
Last Month 381
Dependencies (0)
None
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |