From e1ee7fcda5434cea458a7c83d364c17822a728fc Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 10 Sep 2024 19:41:55 +0200 Subject: [PATCH] feat: andere ports/bind ips erlauben --- flask_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flask_server.py b/flask_server.py index 3b4faa6..efcf7fb 100755 --- a/flask_server.py +++ b/flask_server.py @@ -327,10 +327,11 @@ def get_pdf(): if __name__ == '__main__': try: + host= os.getenv("FLASK_RUN_HOST", "0.0.0.0") port = os.getenv("FLASK_RUN_PORT", 5000) - app.run(debug=True, host="0.0.0.0", port=port) + app.run(debug=True, host=host, port=port) except: - print(f"Coud not bind to port {port}, set FLASK_RUN_PORT.") + print(f"Coud not bind to host {host}:{port}, set FLASK_RUN_HOST and/or FLASK_RUN_PORT.") # PV Forecast: