From 084e3868f99fcbe3d0f9bd16862c6ac8465288d9 Mon Sep 17 00:00:00 2001 From: Marcin-Ramotowski Date: Thu, 10 Apr 2025 20:38:22 +0000 Subject: [PATCH] Changed default port to 80 and added possibility of setup app port using TODOLIST_PORT variable --- api/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/app.py b/api/app.py index 208aaf4..1c2a82a 100644 --- a/api/app.py +++ b/api/app.py @@ -12,7 +12,7 @@ def create_app(config_name="default"): """Creates and returns a new instance of Flask app.""" load_dotenv() app = Flask(__name__) - + # Database settings if config_name == "testing": app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///:memory:" # Database in memory @@ -63,4 +63,5 @@ def create_app(config_name="default"): # Server start only if we run app directly if __name__ == "__main__": app = create_app() - app.run(host="0.0.0.0") + port = os.getenv("TODOLIST_PORT", "80") + app.run(host="0.0.0.0", port=port)