added fastapi to requirements. First step to replace flask with fastapi

This commit is contained in:
2026-02-27 20:43:38 +01:00
parent 2f308584c0
commit 45397c069c
3 changed files with 32 additions and 1 deletions

14
main.py Normal file
View File

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