Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

koajs/koa-rt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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