File size: 269 Bytes
b3a1356
d76c487
b3a1356
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
from fastapi import FastAPI

# FastAPI 인스턴스 생성
app = FastAPI()

# 라우트 생성
@app.get("/")
def read_root():
    return {"Hello": "World"}

@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
    return {"item_id": item_id, "q": q}