use WTTRIN_SRV_PORT env variable if specified

This commit is contained in:
Igor Chubin 2019-07-07 20:40:28 +02:00
parent a95a95cdb2
commit 49376a9871

View file

@ -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()