184. API Development
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/api/hello', methods=['GET'])
def hello_world():
return jsonify({"message": "Hello, World!"})
if __name__ == '__main__':
app.run(debug=True)from fastapi import FastAPI
app = FastAPI()
@app.get("/api/hello")
def hello_world():
return {"message": "Hello, World!"}Last updated