From 7062e14396d3dee342fc7cefb61e8caa06b38f58 Mon Sep 17 00:00:00 2001 From: Marcin-Ramotowski Date: Thu, 10 Apr 2025 21:20:17 +0000 Subject: [PATCH] Switched to waitress as production server --- api/app.py | 3 ++- api/requirements.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/app.py b/api/app.py index 1c2a82a..90fa76f 100644 --- a/api/app.py +++ b/api/app.py @@ -62,6 +62,7 @@ def create_app(config_name="default"): # Server start only if we run app directly if __name__ == "__main__": + from waitress import serve app = create_app() port = os.getenv("TODOLIST_PORT", "80") - app.run(host="0.0.0.0", port=port) + serve(app, host="0.0.0.0", port=port) diff --git a/api/requirements.txt b/api/requirements.txt index 4f817c0..20df243 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -11,4 +11,5 @@ mysql-connector-python==9.2.0 python-dotenv==1.0.0 SQLAlchemy==2.0.23 typing_extensions==4.8.0 +waitress==3.0.2 Werkzeug==3.0.1