I am trying to run a Flask app locally which also needs to access resources run on a separate Flask app deployed on a remote server on the local network. I thought this may be possible using a DispatcherMiddleware layer locally, so, based on examples from:
- http://flask.pocoo.org/docs/0.12/patterns/appdispatch/
- How to implement Flask Application Dispatching by Path with WSGI?
Both examples require the DispatcherMiddleware layer (running locally) to have access to the constituent apps (which may be on a remote server) for example:
from app import app as app1
from app2.app import app as app2
from app3.app import app as app3
application = DispatcherMiddleware(app1, {
'/app2': app2, ##may be remote
'/app3': app3 ##may be remote
})
Is there any way to achieve this pattern given the distributed apps, short of creating a network share mounting the path to the remote server and importing over a network share?