0.0.6 • Published 11 years ago

troute v0.0.6

Weekly downloads
9
License
-
Repository
github
Last release
11 years ago

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 method
  • route - a string or RegExp for route matching
  • fn - 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

0.0.6

11 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago