Middlewares

We moved all middlewares to separate @nanoexpress/middlewares repository

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();
});

Error which comes from Async Middleware automacilly will be handled by nanoexpress

Last updated