Middlewares
Tested Express/Connect like Middlewares
Basic example
app.use((req, res, next) => {
req.appId = 'MY_APP_ID';
next();
});Method defining
function lazyEnd(end) {
setTimeout(() => this.end(end), 0);
}
app.use((req, res, next) => {
res.lazyEnd = lazyEnd;
next();
});Last updated