diff --git a/provider_portal/app/api/customer_api/routes.py b/provider_portal/app/api/customer_api/routes.py index 7e5cd4e..bd41434 100644 --- a/provider_portal/app/api/customer_api/routes.py +++ b/provider_portal/app/api/customer_api/routes.py @@ -53,7 +53,7 @@ def create_meter(): # Extract API key from headers api_key = request.headers['Authorization'] if "Bearer " in api_key: - api_key.replace("Bearer ", "") + api_key = api_key.replace("Bearer ", "") # Extract data from the request body data = json.loads(request.data) @@ -103,7 +103,7 @@ def meter_measurements(): # Extract API key from headers api_key = request.headers['Authorization'] if "Bearer " in api_key: - api_key.replace("Bearer ", "") + api_key = api_key.replace("Bearer ", "") # Extract data from the request query parameters customer_UID = request.args.get('customerUID') @@ -157,7 +157,7 @@ def delete_meter(): # Extract API key from headers api_key = request.headers['Authorization'] if "Bearer " in api_key: - api_key.replace("Bearer ", "") + api_key = api_key.replace("Bearer ", "") # Extract data from the request body data = json.loads(request.data) diff --git a/provider_portal/run.py b/provider_portal/run.py index 2c204fc..01c6c1f 100644 --- a/provider_portal/run.py +++ b/provider_portal/run.py @@ -71,15 +71,15 @@ def run_app(app, host, port, ssl_context): insert_users_from_file(mysql_db) # Threaded Flask applications - smartmeter_thread = threading.Thread(target=run_app, args=(smartmeter_api_app, '10.0.1.10', 8080, ssl_context)) + smartmeter_thread = threading.Thread(target=run_app, args=(smartmeter_api_app, '0.0.0.0', 8080, ssl_context)) smartmeter_thread.start() provider_thread = threading.Thread(target=run_app, args=( - customer_api_app, '10.0.1.10', 8100, (config.CertificateConfig.SERVER_CERT, config.CertificateConfig.SERVER_KEY))) + customer_api_app, '0.0.0.0', 8100, (config.CertificateConfig.SERVER_CERT, config.CertificateConfig.SERVER_KEY))) provider_thread.start() admin_thread = threading.Thread(target=run_app, args=( - admin_api_app, '10.0.1.10', 8090, (config.CertificateConfig.SERVER_CERT, config.CertificateConfig.SERVER_KEY))) + admin_api_app, '0.0.0.0', 8090, (config.CertificateConfig.SERVER_CERT, config.CertificateConfig.SERVER_KEY))) admin_thread.start() # Wait for all threads to finish