From 4c1b4060a5fb9e020765360d212d65c543c3ce1b Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Wed, 1 Jul 2026 09:46:39 +0300 Subject: Add HOST and PORT --- app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app.py') diff --git a/app.py b/app.py index dbeeae2..efbd1b1 100644 --- a/app.py +++ b/app.py @@ -13,6 +13,8 @@ from urllib.parse import parse_qs, urlparse DB = "expenses.db" PAGE_SIZE = 20 BASE_URL = os.environ.get("EXPENSES_BASE_URL", "http://localhost:8000").rstrip("/") +HOST = os.environ.get("HOST", "0.0.0.0") +PORT = int(os.environ.get("PORT", "8000")) def get_db(): @@ -445,7 +447,6 @@ class Handler(BaseHTTPRequestHandler): if __name__ == "__main__": init_db() - port = 8000 - print(f"Running on http://localhost:{port}") - print("Visit http://localhost:{}/new to create a group".format(port)) - HTTPServer(("", port), Handler).serve_forever() + print(f"Running on http://{HOST}:{PORT}") + print(f"Visit http://{HOST}:{PORT}/new to create a group") + HTTPServer((HOST, PORT), Handler).serve_forever() -- cgit v1.3