소스 검색

Add /items endpoint to return a list of items

jezvgg 2 달 전
부모
커밋
1ca8a7598e
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      main.py

+ 4 - 0
main.py

@@ -5,3 +5,7 @@ app = FastAPI()
 @app.get("/")
 def read_root():
     return {"message": "Hello, World!"}
+
+@app.get("/items")
+def get_items():
+    return {"items": ["item1", "item2", "item3"]}