nroute
v1.0.28
Published
Non-bloated Nodejs http server and request handler
Downloads
8
Maintainers
Readme
NRoute
Non-bloated Nodejs http server and request handler that uses Express-inspired middlewares.
Install
npm install nroute
Use
var app = require('nroute');
app.use(function(req, res, next){
console.log('test');
next();
});
app.use(function(req, res, next){
var out = req.url;
res.end(out);
});
// HTTP
app.serve('http')
.listen(8080);
// HTTPS
var fs = require('fs');
var k = fs.readFileSync('key.pem');
var c = fs.readFileSync('crt.pem');
app.serve('https', {
key: k,
cert: c
}).listen(8081);