Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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 '?
 
PREVIOUS NEXT
Tagged: #express #params
ADD COMMENT
Topic
Name
1+1 =