Spaces:
Sleeping
Sleeping
update
Browse files
main.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
| 1 |
+
from typing import Optional
|
| 2 |
+
|
| 3 |
from fastapi import FastAPI
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
+
|
| 8 |
+
@app.get("/items/")
|
| 9 |
+
async def read_item(item_id: int, q: Optional[str] = None):
|
| 10 |
+
return {"item_id": item_id, "q": q}
|