Start with a tiny app and verify your endpoint works.

1
2
3
4
5
6
7
from fastapi import FastAPI

app = FastAPI()

@app.get("/health")
def health_check():
    return {"status": "ok"}

Run the server and visit /docs to test your endpoint.

Saved locally to your browser.