What do middlewares do?
Middleware functions can perform the following tasks:
- Execute any code.
- Make changes to the request and the response objects.
- End the request-response cycle.
- Call the next middleware function in the stack.
middleware do kam karta ha, ya to next ko call karega ya to response bhej dega
MIDDLEWARE ko hamesa upar hi likhe, nahi to extue nahi hoga.
Handling Errors
difference b/w next() vs next(err)?
0 Comments