1763 shaares
17 private links
17 private links
1 result
tagged
multiple-routes
app.get('/:var(bla|blabla)?', todo)
:var sets the req.param that you don't use. it's only used in this case to set the regex.
(bla|blabla) sets the regex to match, so it matches the strings bla and blablah.
? makes the entire regex optional, so it matches / as well.