mirror of
https://github.com/rjNemo/docker_examples
synced 2026-06-06 10:36:47 +00:00
13 lines
246 B
Python
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}
|