Hi, all.
I'm not sure whether this is a bug or intentional, but while this code snippet functions just fine:
app.param(['id', 'page'], function (req, res, next, value) {
console.log(value);
next();
});
app.get('/user/:id/:page', function (req, res) {
console.log('and this matches too');
res.end();
});
This does not:
app.param(['id-imp', 'page'], function (req, res, next, value) {
console.log(value);
next();
});
app.get('/user/:id-imp/:page', function (req, res) {
console.log('and this matches too');
res.end();
});
-----
Adding a dash makes the whole thing not function. I understand that there are probably solid reasons for why dashed variable names aren't being accepted, but would it be possible to add a note in the documentation about it? I spent several hours trying to understand why the code wouldn't function and perhaps it can save someone else the time.
Sincerely,
Smit Jain.