Min FastAPI-Server
This commit is contained in:
Binary file not shown.
@@ -2,6 +2,12 @@ from fastapi import FastAPI
|
|||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
app.get("/")
|
|
||||||
async def root():
|
@app.get("/")
|
||||||
return {"massege": "Hello world"}
|
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}
|
||||||
Reference in New Issue
Block a user