https://fastapi.tiangolo.com/tutorial/first-steps/
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"message": "Olá, mundo!"}
@app.get("/hello/{name}")
def say_hello(name: str):
return {"message": f"Olá, {name}!"}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
http://localhost:8000/redoc