Concept Flow - WSGI middleware concept
Client Request
WSGI Server
Middleware: Receives Request
Middleware: Processes or Modifies Request
Passes Request to Flask App
Flask App: Generates Response
Middleware: Receives Response
Middleware: Processes or Modifies Response
WSGI Server
Client Receives Response
The WSGI middleware sits between the server and the Flask app, intercepting requests and responses to modify or process them before passing along.