From 2fac9d0f83b3847d887a7386dec2b6c3c7c25ab7 Mon Sep 17 00:00:00 2001 From: choisungwook Date: Wed, 27 Apr 2022 21:07:25 +0900 Subject: [PATCH] =?UTF-8?q?fastapi=20=C3=A3=EC=98=88=EC=A0=9C=EB=A9=94?= =?UTF-8?q?=C3=AC=C2=9E=EC=98=88=EC=A0=9C=EB=A9=94=EC=9D=B8=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 12 ++++++++++++ app/requirements.txt | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 app/main.py create mode 100644 app/requirements.txt diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..d75f845 --- /dev/null +++ b/app/main.py @@ -0,0 +1,12 @@ +from typing import Optional +from fastapi import FastAPI + +app = FastAPI() + +@app.get("/") +def read_root(): + return {"Hello": "World"} + +@app.get("/items/{item_id}") +def read_item(item_id: int, q: Optional[str] = None): + return {"item_id": item_id, "q": q} diff --git a/app/requirements.txt b/app/requirements.txt new file mode 100644 index 0000000..4bbfee0 --- /dev/null +++ b/app/requirements.txt @@ -0,0 +1,13 @@ +anyio==3.5.0 +asgiref==3.5.0 +click==8.1.2 +colorama==0.4.4 +fastapi==0.75.2 +h11==0.13.0 +idna==3.3 +pydantic==1.9.0 +python-dotenv==0.20.0 +sniffio==1.2.0 +starlette==0.17.1 +typing_extensions==4.2.0 +uvicorn==0.17.6