From 49376a9871b2869dea569c3a3ca0de22723c4a74 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sun, 7 Jul 2019 20:40:28 +0200 Subject: [PATCH] use WTTRIN_SRV_PORT env variable if specified --- bin/srv.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/srv.py b/bin/srv.py index 3214a58..8d4f447 100644 --- a/bin/srv.py +++ b/bin/srv.py @@ -50,5 +50,7 @@ def wttr(location=None): "Main function wrapper" return wttr_srv.wttr(location, request) -SERVER = WSGIServer((LISTEN_HOST, LISTEN_PORT), APP) +SERVER = WSGIServer( + (LISTEN_HOST, int(os.environ.get('WTTRIN_SRV_PORT', LISTEN_PORT))), + APP) SERVER.serve_forever()