Spaces:
Runtime error
Runtime error
Commit
•
8eed7e4
1
Parent(s):
246848e
add missing app logic
Browse files- app/app.py +15 -0
app/app.py
CHANGED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Union
|
2 |
+
|
3 |
+
from fastapi import FastAPI
|
4 |
+
|
5 |
+
app = FastAPI()
|
6 |
+
|
7 |
+
|
8 |
+
@app.get("/")
|
9 |
+
def read_root():
|
10 |
+
return {"Hello": "World"}
|
11 |
+
|
12 |
+
|
13 |
+
@app.get("/items/{item_id}")
|
14 |
+
def read_item(item_id: int, q: Union[str, None] = None):
|
15 |
+
return {"item_id": item_id, "q": q}
|