in courses/DSL/clicks-service/main.py [0:0]
def receive_message():
envelope = request.get_json()
if not envelope:
return 'Bad Request: No message received', 400
message = envelope.get('message')
if not message:
return 'Bad Request: Invalid message format', 400
message_data = message.get('data')
decoded_message_data = base64.b64decode(message_data).decode('utf-8')
print(f'decoded_message_data: {decoded_message_data}')
return 'OK', 200