routing-buddy/lib
Buddy Sandidge 7c34964dff Add support for functions in router
Can add a function as to match a route. The function takes in a string
url segment and returns some value if the route matches or returns null
or undefined for no match.

Example usage:

function toInt(part) {
  var results = /^(\d+)$/.exec(part)
  return results ? parseInt(results[0], 10) : null
}

var router = new Router()
router.add(['/by/order', toInt], function (val) {
  // val === 123
})

router.route('/by/order/123')
2016-02-07 21:11:51 -08:00
..
route-node.js Add support for functions in router 2016-02-07 21:11:51 -08:00
router.js Add support for regular expressions with capture groups 2016-02-07 20:28:32 -08:00
utils.js Add support for functions in router 2016-02-07 21:11:51 -08:00