Skip to content

Instantly share code, notes, and snippets.

@boris317
Created September 19, 2012 15:07
Show Gist options
  • Select an option

  • Save boris317/3750160 to your computer and use it in GitHub Desktop.

Select an option

Save boris317/3750160 to your computer and use it in GitHub Desktop.
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)
# 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