Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua committed Dec 7, 2023
1 parent 50461fb commit b802278
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions provider_portal/app/api/customer_api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions provider_portal/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b802278

Please sign in to comment.