To add a single routing handler for multiple routes in a single line with Node.js Express.js, we call the route method with an array of routes.
For instance, we write
app.get(
[
"/test",
"/alternative",
"/bar*",
"/foo/:farcus/",
"/hoop(|la|lapoo|lul)/poo",
],
(request, response) => {}
);
to create a get route handler that accepts requests from the URLs listed in the array.