Where is app.all ('*') in the chain? If it is after all other routes it cannot be called.
app.post("/something",function(req,res,next){ ...dothings.... res.send(200); });
app.all('*',function(req,res) { ...this NEVER gets called. No next and res already sent });
If it was your intention to be the last, then you should definitely call next () in the previous routes. For example:
app.post("/something",function(req,res,next){ ...dothings.... next();});
app.all('*',function(req,res) { ...this gets called });
Also, what's in doSomething? Are you sure you didn’t call him?
source
share