I am running the latest express (4.1.1 as of writing). It has this middleware included to serve static files.
So the usual code to include this middleware is:
app.use(express.static(path.join(__dirname, 'public')));
And great that all works fine. But if I try to include a middleware before that, eg:
app.use(function(req,res,next){
next();
}, express.static(path.join(__dirname, 'public')));
The serve-static middleware now gives me 404s.
I am not sure why this is happening. Did I implement the middleware that goes before the static middleware incorrectly?