Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,13 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
|
3 |
+
# FastAPI 인스턴스 생성
|
4 |
+
app = FastAPI()
|
5 |
+
|
6 |
+
# 라우트 생성
|
7 |
+
@app.get("/")
|
8 |
+
def read_root():
|
9 |
+
return {"Hello": "World"}
|
10 |
+
|
11 |
+
@app.get("/items/{item_id}")
|
12 |
+
def read_item(item_id: int, q: str = None):
|
13 |
+
return {"item_id": item_id, "q": q}
|