26 lines
505 B
Python
26 lines
505 B
Python
|
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()
|