Allow enabling debug endpoints with env var

This commit is contained in:
2024-03-02 21:49:39 +01:00
parent dfb9360125
commit 5dcebab545
2 changed files with 21 additions and 11 deletions

View File

@ -4,9 +4,12 @@ from flask_sqlalchemy import SQLAlchemy
# Load local ENV variables (can be set when calling the executable)
ENABLE_TIMING: bool = False if os.getenv("DISABLE_TIMING") == "True" else True
ENABLE_DEBUG_ENDPOINTS: bool = True if os.getenv("ENABLE_DEBUG_ENDPOINTS") == "True" else False
print("Running Formula10 with:")
if not ENABLE_TIMING:
print("- Disabled timing constraints")
if ENABLE_DEBUG_ENDPOINTS:
print("- Enabled debug endpoints")
app: Flask = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///formula10.db"