zhuwq0 commited on
Commit
6436614
·
1 Parent(s): 7487ea3
Files changed (1) hide show
  1. main.py +6 -3
main.py CHANGED
@@ -1,7 +1,10 @@
 
 
1
  from fastapi import FastAPI
2
 
3
  app = FastAPI()
4
 
5
- @app.get("/")
6
- def read_root():
7
- return {"Hello": "World!"}
 
 
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}