Node.js/Express routing with get params

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)