Skip to content

Instantly share code, notes, and snippets.

@jfhbrook
Created April 26, 2019 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfhbrook/e13555f7aa7acd14ea12b0bbd596ed18 to your computer and use it in GitHub Desktop.
Save jfhbrook/e13555f7aa7acd14ea12b0bbd596ed18 to your computer and use it in GitHub Desktop.
Our kinja-service Flask app factory
def create_app(service_name):
app = KinjaApp(__name__)
app.config['KINJA_SERVICE_NAME'] = service_name
app.register_error_handler(Exception, general_error_handler)
app.register_error_handler(HTTPException, http_error_handler)
app.register_error_handler(Invalid, validation_error_handler)
init_ops(app)
return app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment