I came across this question looking for the same functionality.
@Jonathan Ong mentions in a comment above that using arrays for paths is deprecated, but it is explicitly described in Express 4, and it works in Express 3.x. Here is an example of something to try:
app.get( ['/test', '/alternative', '/barcus*', '/farcus/:farcus/', '/hoop(|la|lapoo|lul)/poo'], function ( request, response ) { } );
From inside the request object with the path /hooplul/poo?bandle=froo&bandle=pee&bof=blarg :
"route": { "keys": [ { "optional": false, "name": "farcus" } ], "callbacks": [ null ], "params": [ null, null, "lul" ], "regexp": {}, "path": [ "/test", "/alternative", "/barcus*", "/farcus/:farcus/", "/hoop(|la|lapoo|lul)/poo" ], "method": "get" },
Note what happens to the parameters: he knows the capture groups and parameters in all possible ways, regardless of whether they are used or not in the current request.
Thus, stacking multiple paths through an array can be done easily, but the side effects are probably unpredictable if you are hoping to get something useful from a path that was used as parameters or capture groups. This is probably more useful for redundancy / smoothing, in which case it will work very well.
Edit: see also @ c24w answer below .
Edit 2: This is a moderately popular answer. Keep in mind that ExpressJS, like most Node.js libraries, is a moving holiday. Although the above routing still works (I am using it at the moment, itβs a very convenient function), I canβt vouch for the output of the request object (this, of course, is different from what I described). Please test thoroughly to make sure you get the results you want.