path-match
1.2.4 • Public • Published path match
Thin wrapper around path-to-regexp to make extracting the param names easier.
var route = require('path-match')({
sensitive: false,
strict: false,
end: false,
});
var match = route('/post/:id');
var parse = require('url').parse;
require('http').createServer(function (req, res) {
var params = match(parse(req.url).pathname);
if (params === false) {
res.statusCode = 404;
res.end();
return;
}
var id = params.id;
})
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 1.2.4
442,948
Version History
Package Sidebar
Install
Weekly Downloads