Let\'s say I have get route like this:
app.get(\'/documents/format/type\', function (req, res) {
var format = req.p
Your route isn't ok, it should be like this (with ':')
app.get('/documents/:format/:type', function (req, res) {
var format = req.params.format,
type = req.params.type;
});
Also you cannot interchange parameter order unfortunately.
For more information on req.params
(and req.query
) check out the api reference here.
For Query parameters like domain.com/test?format=json&type=mini
format, then you can easily receive it via - req.query.
app.get('/test', function(req, res){
var format = req.query.format,
type = req.query.type;
});