Node.js: Difference between req.query[] and req.params
Given this route app.get(‘/hi/:param1’, function(req,res){} ); // regex version app.get(/^\/hi\/(.*)$/, function(req,res){} ); // unnamed wild card app.get(‘/hi/*’, function(req,res){} ); and given this URL http://www.google.com/hi/there?qs1=you&qs2=tube You will have: req.query { qs1: ‘you’, qs2: ‘tube’ } req.params { param1: ‘there’ } When you use a regular expression for the route definition, capture groups are provided in the … Read more