This package has been deprecated
Author message:
This package is archived and no longer maintained. For support, visit https://github.com/expressjs/express/discussions
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;
})
Package Sidebar
Install
Weekly Downloads