Express route param breaks on params containing "@" -
have simple express route
router.get('/compare/:packages', function(req, res, next) { const packages = req.params.packages.split(','); res.render('index', { title: "title" }); });
when accessing contains @ sign, doesn't match , returns 404, help?
/compare/elm,@cycle/run
edit: worked
router.get('/compare/:packages*', function(req, res, next) { const packages = req.params.packages.split(','); res.render('index', { title: "title" }); });
the issue isn't @
, it's /
before /run
, because default, parameters delimited slashes.
you can use this:
router.get('/compare/*', function(req, res, next) { const packages = req.params[0].split(','); res.render('index', { title: "title" }); });
Comments
Post a Comment