Middlewares
We moved all middlewares to separate @nanoexpress/middlewares repository
Tested Express/Connect like Middlewares
body-parser (yes, if you don't want built-in)
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
Was this helpful?