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
14 lines
457 B
Python
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)
|