To use multiple parameters in URL in Node.js Express, we add multiple parameter placeholders.
For instance, we write
app.get("/fruit/:fruitName/:fruitColor", (req, res) => {
const data = {
fruit: {
apple: req.params.fruitName,
color: req.params.fruitColor,
},
};
send.json(data);
});
to add the fruitName and fruitColor URL placeholders for the get route.
Then we get their values from the req.params object.