Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node express params

// url = /something/2?color1=red&color2=blue&type=square

app.get('/something/:id', (req, res) => {
  	req.params.id  === 2 // true
    req.query.color1 === 'red'  // true
    req.query.color2 === 'blue' // true
    req.query.type === 'square' // true
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #node #express #params
ADD COMMENT
Topic
Name
7+5 =