I came across the following behavior:
When I have several middleware installed, the request continues to cascade to the next middleware, although I explicitly end the request with the help res.json()in the previous middleware. Also note that I DO NOT call next()anywhere in the middleware mentioned.
app.use('/v1/status', function (req, res, next) {
res.json({ status: 'ok' });
});
app.use(function (req, res, next) {
console.log('I always get called');
});
Is this a "new" behavior? Because for my understanding (and 4x docs) this should not happen.
Any help would be greatly appreciated.
express v4.13.0 on mac osx
source
share