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
This commit is contained in:
13
pico_2026/test_webserver.py
Normal file
13
pico_2026/test_webserver.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user