Created
April 26, 2019 16:16
-
-
Save jfhbrook/e13555f7aa7acd14ea12b0bbd596ed18 to your computer and use it in GitHub Desktop.
Our kinja-service Flask app factory
This file contains 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 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