Min FastAPI-Server

This commit is contained in:
2026-03-06 10:48:07 +01:00
parent 5d563f8c9d
commit af2547b54a
2 changed files with 9 additions and 3 deletions

View File

@@ -2,6 +2,12 @@ from fastapi import FastAPI
app = FastAPI()
app.get("/")
async def root():
return {"massege": "Hello world"}
@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}