Fend.js router for server
$ npm install fendjs-router-server
var connect = require('connect');
var http = require('http');
var ServerRouter = require('fendjs-router-server');
var router = new ServerRouter();
router.route('get', '/', function () {
this.res.end('home');
});
router.router('get', '/users/:name', function () {
this.res.end('foo');
});
var app = connect()
.use(router.middleware)
http.createServer(app).listen(3000);
Initialize a new ServerRouter
with the given options
.
Return connect middleware.
$ npm install
$ make test
See the LICENSE
.