Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to access the GET parameters after “?” in Express

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 '?
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #access #GET #parameters #Express
ADD COMMENT
Topic
Name
2+3 =