1.0.8 • Published 8 years ago

mrl v1.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

mrl

light-weight HTTP framework for node.js to make web applications and APIs more enjoyable to write; who can use express's middlewave and kos's middlewave

Code is for reference only, not for the production environment! 代码仅供参考,切勿用于生产环境!

Installation

$ npm install mrl

Example

var mr = require('mrl');
var app = mrl();
app.use(function*(next){
    this.body = 'hello';
    yield next;
});
app.use(function(req,res,next){
    if(this.body!='hello'){
        res.end('hi');
        return;
    }
    next();
});
app.use(function(req,res){
    console.log(this.body);//hello
    res.end('hello world!');
});
app.listen(3000,function(){
    console.log('listen on port:',3000);
});

License

MIT

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago