Message is being sent as json(dict)

This commit is contained in:
Peter Stockings
2023-01-04 18:04:11 +11:00
parent cc1ee982c5
commit 7d14a40cd6

2
app.py
View File

@@ -38,7 +38,7 @@ def response_minify(response):
def handle_message(data): def handle_message(data):
current_time = datetime.now().replace( current_time = datetime.now().replace(
microsecond=0).isoformat() microsecond=0).isoformat()
print('' + current_time + ' ' + data) print('' + current_time + ' ' + json.dumps(data))
@app.route("/api/status", methods=['GET', 'POST']) @app.route("/api/status", methods=['GET', 'POST'])