0.0.6 • Published 12 years ago
troute v0.0.6
troute
super fast tiny router
install
$ npm insall trouteusage
using troute is super simple
api
troute(method, route, fn)
troute accepts a valid http method, a string or RegExp route, and a function fn(req, res, next) as a callback
method- a valid http methodroute- a string orRegExpfor route matchingfn- a callback function when the route is matched
see sregex for more information defining string and RegExp routes
example
require('http').createServer(troute('GET', '/home', function (req, res) {
res.end('+1');
})).listen(8000);license
MIT