0.0.6 • Published 11 years ago
troute v0.0.6
troute
super fast tiny router
install
$ npm insall troute
usage
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 orRegExp
for 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