Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

make query param optional node

app.get('/user/:id?', function userIdHandler (req, res) {
  console.log(req.route)
  res.send('GET')
})
Source by expressjs.com #
 
PREVIOUS NEXT
Tagged: #query #param #optional #node
ADD COMMENT
Topic
Name
8+8 =