docker_examples/python/app/main.py
2022-12-09 22:21:41 +01:00

13 lines
246 B
Python

from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root() -> dict:
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str | None = None) -> dict:
return {"item_id": item_id, "q": q}