You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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')
10 years ago
..
route-node.js Add support for functions in router 10 years ago
router.js Add support for regular expressions with capture groups 10 years ago
utils.js Add support for functions in router 10 years ago