Arguments passed in to the route method at route time will be passed in
to the handler for that route.
var router = new Router()
router.add('/some/path' function (someParam) {
// someParam would be 123
})
router.route('/some/path', {args: [123]})
Router
• add can take either a string or array
• An array will check each item, for a string will be converted
to an array
RouteNode
• rename this._exact → this._children
• exact matches will not have a '/' in a key because we split on
the '/' character and RegExp will have a '/' in it
• If an exact match can't be found first, check every regex on a node
• Exact match will have preference over RegExp
utils
• add forEach helper
• add isArray and isRegExp checker
• Add linting with eslint
• Add unit testing support with mocha with unit tests
• Add Router class with support for only matching exact strings
• Add RouteNode class for transversing all routes