Concept Flow - Why middleware processes requests before handlers
Incoming HTTP Request
Middleware Processes Request
Pass to Next Middleware or Handler
Route Handler Executes
Response Sent Back
The request first goes through middleware which can modify or check it before passing it to the route handler that sends the response.