lib-route-matcher
v0.0.0
Published
route matching
Downloads
6
Readme
Routes.js
install
npm install --save lib-route-matcher
usage
var route = require('lib-route-matcher')().New();
route.add('/users/:name', HANDLE);
route.match('/users/bob?sort=desc');
// {
// handle: HANDLE,
// params: {
// name: 'bob'
// },
// query: {
// sort: 'desc'
// }
// }
Where HANDLE
can be a function, a token, or anything you like.