nanoexpress
GitHubKnown BugsFAQ
  • Getting Started
  • Server
  • Middlewares
  • Routes
    • Static Serve
    • Request
    • Response
    • Route
    • Errors handling
  • Schemas
  • WebSocket
  • Docker / Linux
  • Optimizations
  • Benchmarks
  • Known bugs
  • Sponsors
  • FAQ
  • License
Powered by GitBook
On this page
  • Tested Express/Connect like Middlewares
  • Basic example
  • Method defining

Was this helpful?

Middlewares

PreviousServerNextRoutes

Last updated 9 months ago

Was this helpful?

We moved all middlewares to separate repository

Tested Express/Connect like Middlewares

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

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

@nanoexpress/middlewares
body-parser
express-fileupload
express-cors
express-jwt
express-session
express-graphql
passport