Serving Flask under a subpath
Your Flask app object implements the
__call__ method, which means it can be called like a regular function.
When your WSGI container receives a HTTP request it calls your app with the
environ dict and the
WSGI is specified in PEP 0333.
The two relevant environ variables are:
The initial portion of the request URL's "path" that corresponds to the application object, so that the application knows its virtual "location". This may be an empty string, if the application corresponds to the "root" of the server.