Files
rate_music/pico_2026/test_webserver.py
structix 4da779a125 Add pico 2026 update
Vibecoded:
- User binary input of the user id
- confirms with send button
- User input of the rating
- Send button sends a get request to the server
2026-03-27 22:42:43 +01:00

14 lines
457 B
Python

from flask import Flask, request
app = Flask(__name__)
# Endpoint for receiving ratings
@app.route('/ratings/<int:user_id>/<int:rating>', methods=['GET'])
def receive_rating(user_id: int, rating: int):
print(f"Received rating: User {user_id} -> {rating}")
return f"Received rating {rating} for user {user_id}!", 200
if __name__ == '__main__':
# Listen on all interfaces, port 3000 as defined in main.py
app.run(host="0.0.0.0", port=3000)