Concept Flow - next() function and flow control
Request received
Middleware 1
Calls next()?
Middleware 2
Calls next()?
Middleware 3
Final handler or error handler
The request passes through middleware functions one by one. Each middleware calls next() to pass control to the next middleware. If next() is not called, the flow stops and response is sent.