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

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago