route-emitter
Dead-simple routing for node.
usage
var http = Router = Router router = router // listen for any http verb!router // or you can catch 404srouter // ...or verb-specific 404srouter // create a listener with named emitter!router // react to the emit!router // catch named parameters!router // catch splats!router // or roll your own regexp!router http
other info
order of operations
(verb)/path
literal, if found(verb)/path params || splat || regexp
if found(verb)/*
if found*/path
literal, if found*/path params || splat || regexp
if found*/*
- at this point, route-emitter does a last-ditch effort to find a handler and
emits an event named
(verb):(path)
. if no listeners are attached to that specific event, it logs an unmatched route toprocess.stdout
params
values
params._splat
array of splat resultsparams._1
-params._x
1-x splat resultsparams._captured
array of captured results from custom RegExpparams.$1
-$params.$x
1-x captured results
license
MIT