Adding Middleware

suggest change

Middleware functions are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle.

Middleware functions can execute any code, make changes to res and req objects, end response cycle and call next middleware.

Very common example of middleware is cors module. To add CORS support, simply install it, require it and put this line:

app.use(cors());

before any routers or routing functions.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Web apps with Express:
* Adding Middleware

Table Of Contents
1 npm
2 Web apps with Express
41 cli
43 grunt
59 Hack
64 ES6
67 Redis
69 MongoDB
86 MongoDB
87 Lodash
91 CORS
105 N-API
108 Require