test-code-refactor #1

Merged
pikram merged 6 commits from test-code-refactor into main 2025-04-10 20:46:21 +00:00
4 changed files with 118 additions and 169 deletions
Showing only changes of commit 084e3868f9 - Show all commits

View File

@ -12,7 +12,7 @@ def create_app(config_name="default"):
"""Creates and returns a new instance of Flask app.""" """Creates and returns a new instance of Flask app."""
load_dotenv() load_dotenv()
app = Flask(__name__) app = Flask(__name__)
# Database settings # Database settings
if config_name == "testing": if config_name == "testing":
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///:memory:" # Database in memory 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 # Server start only if we run app directly
if __name__ == "__main__": if __name__ == "__main__":
app = create_app() 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)