Verified Commit 38420028 authored by Dan Jones's avatar Dan Jones
Browse files

feat: enable flask debug mode from env var

parent 43d499c4
......@@ -25,6 +25,8 @@ URL_PREFIX = os.getenv("URL_PREFIX", "")
FLASK_HOST = os.getenv("FLASK_HOST", "localhost")
# Allow env override of default port
FLASK_PORT = os.getenv("FLASK_PORT", 5000)
# Switch on debug mode if env var is truthy
FLASK_DEBUG = os.getenv("FLASK_DEBUG", "False").lower() in ("true", "1", "t")
swagger_config = {
......@@ -156,7 +158,7 @@ def serve(swagger_config):
Run as local flask app on FLASK_PORT|5000
"""
app = configure_flask(swagger_config)
app.run(debug=True, host=FLASK_HOST, port=FLASK_PORT)
app.run(debug=FLASK_DEBUG, host=FLASK_HOST, port=FLASK_PORT)
def compile_schema(swagger_config):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment