Multiple query parameters with same name
You can use the usual req.query. Whenever there's multiple query parameters with the same name, req.query[paramName]
will return an array instead of the value. So in your case:
app.get("/page", (req, res) => { const { id } = req.query console.log("ID is "+ id) });// GET www.example.com/page?id=1&id=2&id=3// ID is ["1", "2", "3"]// GET www.example.com/page?id=12345// ID is 12345