How should I handle routes in Express when users enter random URL's that include multiple forward slashes?
For URL's that don't match actual directories I can do this but it is really horrible. When i go to mysite.com/randomNoise/anythingHere/blahblah the following will render my 404...
app.get('/:anything1/:anything2/:anything3', (req, res) => {
res.render("../theme/404")
})
Like I said, it's not very nice and will not work when even more sub directories are added, I end up with the standard cannot GET / etc Example:
mysite.com/something/somethingelse/whatever/extraGarbage
Is there a way to stop Express sending "Cannot GET /" messages or a way to handle when that happens?