The simple way to use FastAPI is as follow,
pip install "fastapi[all]" pip install "uvicorn[standard]"
from fastapi import FastAPI app = FastAPI() @app.get("/") async def root(): return {"message": "Hello World"}
Run the FastAPI.
uvicorn main:app --reload