TP_JO2024/athlete/app.py

26 lines
505 B
Python
Raw Normal View History

2024-03-27 11:18:57 +01:00
from flask import Flask, jsonify
import athlete
app = Flask(__name__)
@app.route('/ping', methods=["GET"])
def ping():
return jsonify({"message": "pong"}), 200
@app.route('/', methods=["GET"])
def hello_world():
return jsonify(athlete.Athlete(
id=1,
prenom="john",
nom="doe",
pays="France",
sexe="Homme",
image="localhost",
disciplines=[123],
).model_dump())
def create_app():
return app
if __name__ == '__main__':
app.run()