Answers for "express get params after ?"


express get params after ?

GET /something?color1=red&color2=blue

app.get('/something', (req, res) => {
    req.query.color1 === 'red'  // true
    req.query.color2 === 'blue' // true

req.params refers to items with a ':' in the URL and req.query refers to items associated with the '?
Posted by: Guest on July-03-2020

express get url parameters

app.get('/path/:name', function(req, res) {
  res.send("tagId is set to " +;
Posted by: Guest on July-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language