Created
September 19, 2012 15:07
-
-
Save boris317/3750160 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def api_url_for(endpoint, **values): | |
| # probably handle missing api_app key in some | |
| # special exception. | |
| api_app = current_app().config["api_app"] | |
| with api_app.app_context(): | |
| return url_for(end_point, **values) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Somewhere in an app factory | |
| def make_app(): | |
| #do some config tuff | |
| front_end_app.config["api_app"] = api_app | |
| app = DispatcherMiddleware(app, { | |
| '/frontend': front_end_app, | |
| '/api': api_app | |
| }) | |
| return app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment