I have several routes implemented and I want to have express reach a default route before they are reached such as the following:
app.get('/', function(req,res,next){
console.log('default route');
// Do some work
next('route');
}
Unfortunately this route is never reached, express simply passes by it. It does match, however, when I change the route slightly, like so:
app.get('/:bogus', function(req,res,next){
...
next('route');
}
Why is the extra specificity needed? Why doesn't express always match on '/'?