📝 Add first tutorial src files

This commit is contained in:
Sebastián Ramírez committed 2018-12-13 21:05:15 +04:00
1 parent 948a39af95
commit 7da0233e35
68 files changed
+1404

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
from fastapi import FastAPI, Query, Path
app = FastAPI()
@app.get("/items/{item_id}")
async def read_items(
*,
item_id: int = Path(..., title="The ID of the item to get", gt=0, le=1000),
q: str,
):
results = {"item_id": item_id}
if q:
results.update({"q": q})
return results