Short and easy FastAPI startup for a quick playground and testing.

pip install fastapi
pip install uvicorn

– main.py –

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}

@app.get("/hello")
def read_root():
    return {"Hello": "Hello"}

To start using uvicorn:

uvicorn app.main:app --host 127.0.0.1 --port 8089