diff --git a/things/calculator/http/flask/main.py b/things/calculator/http/flask/main.py index eac0e01..21d5f06 100644 --- a/things/calculator/http/flask/main.py +++ b/things/calculator/http/flask/main.py @@ -22,11 +22,11 @@ cli.show_server_banner = lambda *x: click.echo("ThingIsReady") -hostname = "0.0.0.0" +td_hostname = "0.0.0.0" portNumber = 5000 if "HOSTNAME" in os.environ: - hostname = os.environ["HOSTNAME"] + td_hostname = os.environ["HOSTNAME"] if "PORT" in os.environ: portNumber = os.environ["PORT"] @@ -44,7 +44,7 @@ thingModel["@type"] = 'Thing' thingModel = json.dumps(thingModel) thingModel = thingModel.replace('{{PROTOCOL}}', 'http') -thingModel = thingModel.replace('{{HOSTNAME}}', hostname) +thingModel = thingModel.replace('{{HOSTNAME}}', td_hostname) thingModel = thingModel.replace('{{PROPERTIES}}', PROPERTIES) thingModel = thingModel.replace('{{ACTIONS}}', ACTIONS) thingModel = thingModel.replace('{{EVENTS}}', EVENTS) @@ -158,4 +158,4 @@ def stream(): port = 5000 if __name__ == "__main__": - app.run(debug=False, host=hostname, port=port) + app.run(debug=False, host="0.0.0.0", port=port)