diff --git a/.env.example b/.env.example index dc2fe20..9093db1 100644 --- a/.env.example +++ b/.env.example @@ -11,6 +11,7 @@ # The debug console executes Python on the host machine. Keep it true on your # own laptop for hot reloading; set it false on anything anyone else can reach. DASH_DEBUG=true +PORT=5050 # --------------------------------------------------------------------------- diff --git a/src/app.py b/src/app.py index 26b472e..c8db985 100644 --- a/src/app.py +++ b/src/app.py @@ -24,6 +24,7 @@ # Load environemnt variables into globals DASH_DEBUG = os.getenv("DASH_DEBUG", "true").strip().lower() == "true" +PORT = int((os.getenv("PORT", "5050") or "5050").strip()) MOCK_PLATFORM_HEADER = int(os.getenv("MOCK_PLATFORM_HEADER", "0") or 0) MOCK_PLATFORM_SPACER = int(os.getenv("MOCK_PLATFORM_SPACER", "20") or 20) LOG_MEMORY = os.getenv("LOG_MEMORY", "false").strip().lower() == "true" @@ -134,5 +135,5 @@ def highlight_active_tab(pathname): if __name__ == "__main__": - # Run the app. Set DASH_DEBUG in .env to toggle debug mode. - app.run(debug=DASH_DEBUG) + # Run the app. Set DASH_DEBUG and PORT in .env to configure. + app.run(debug=DASH_DEBUG, port=PORT)