node express optional query params code example
Example 1: make query param optional node
app.get('/user/:id?', function userIdHandler (req, res) {
console.log(req.route)
res.send('GET')
})
Example 2: make query param optional node
app.get('path/:required/:optional?*, ...)