|
|
@ -180,7 +180,7 @@ entrypoint = "backend.main:app" |
|
|
from backend.main import app |
|
|
from backend.main import app |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
### `fastapi dev`์ ๊ฒฝ๋ก ์ง์ ํ๊ธฐ { #fastapi-dev-with-path } |
|
|
### `fastapi dev`๋ฅผ ๊ฒฝ๋ก ๋๋ `--entrypoint` CLI ์ต์
๊ณผ ํจ๊ป ์ฌ์ฉํ๊ธฐ { #fastapi-dev-with-path-or-with-entrypoint-cli-option } |
|
|
|
|
|
|
|
|
`fastapi dev` ๋ช
๋ น์ด์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ ๋ฌํ ์๋ ์์ผ๋ฉฐ, ๊ทธ๋ฌ๋ฉด ์ฌ์ฉํ FastAPI app ๊ฐ์ฒด๋ฅผ ์ถ์ ํฉ๋๋ค: |
|
|
`fastapi dev` ๋ช
๋ น์ด์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ ๋ฌํ ์๋ ์์ผ๋ฉฐ, ๊ทธ๋ฌ๋ฉด ์ฌ์ฉํ FastAPI app ๊ฐ์ฒด๋ฅผ ์ถ์ ํฉ๋๋ค: |
|
|
|
|
|
|
|
|
@ -188,29 +188,19 @@ from backend.main import app |
|
|
$ fastapi dev main.py |
|
|
$ fastapi dev main.py |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
ํ์ง๋ง ๋งค๋ฒ `fastapi` ๋ช
๋ น์ด๋ฅผ ํธ์ถํ ๋๋ง๋ค ์ฌ๋ฐ๋ฅธ ๊ฒฝ๋ก๋ฅผ ์ ๋ฌํด์ผ ํฉ๋๋ค. |
|
|
๋๋ `fastapi dev` ๋ช
๋ น์ด์ `--entrypoint` ์ต์
์ ์ ๋ฌํ ์๋ ์์ต๋๋ค: |
|
|
|
|
|
|
|
|
๋ํ ๋ค๋ฅธ ๋๊ตฌ๋ค, ์๋ฅผ ๋ค์ด [VS Code ํ์ฅ](../editor-support.md)์ด๋ [FastAPI Cloud](https://fastapicloud.com)๊ฐ ์ด๋ฅผ ์ฐพ์ง ๋ชปํ ์ ์์ผ๋ฏ๋ก, `pyproject.toml`์ `entrypoint`๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. |
|
|
|
|
|
|
|
|
|
|
|
### ์ฑ ๋ฐฐํฌํ๊ธฐ(์ ํ ์ฌํญ) { #deploy-your-app-optional } |
|
|
|
|
|
|
|
|
|
|
|
์ ํ์ ์ผ๋ก FastAPI ์ฑ์ [FastAPI Cloud](https://fastapicloud.com)์ ๋ฐฐํฌํ ์ ์์ต๋๋ค. ์์ง ๋๊ธฐ์ ๋ช
๋จ์ ๋ฑ๋กํ์ง ์์๋ค๋ฉด, ๋ฑ๋กํ๋ฌ ๊ฐ์ธ์. ๐ |
|
|
|
|
|
|
|
|
|
|
|
์ด๋ฏธ **FastAPI Cloud** ๊ณ์ ์ด ์๋ค๋ฉด(๋๊ธฐ์ ๋ช
๋จ์์ ์ด๋ํด ๋๋ ธ์ต๋๋ค ๐), ํ ๋ฒ์ ๋ช
๋ น์ผ๋ก ์ ํ๋ฆฌ์ผ์ด์
์ ๋ฐฐํฌํ ์ ์์ต๋๋ค. |
|
|
|
|
|
|
|
|
|
|
|
๋ฐฐํฌํ๊ธฐ ์ ์, ๋ก๊ทธ์ธ๋์ด ์๋์ง ํ์ธํ์ธ์: |
|
|
|
|
|
|
|
|
|
|
|
<div class="termy"> |
|
|
|
|
|
|
|
|
|
|
|
```console |
|
|
```console |
|
|
$ fastapi login |
|
|
$ fastapi dev --entrypoint main:app |
|
|
|
|
|
|
|
|
You are logged in to FastAPI Cloud ๐ |
|
|
|
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
</div> |
|
|
ํ์ง๋ง ๋งค๋ฒ `fastapi` ๋ช
๋ น์ด๋ฅผ ํธ์ถํ ๋๋ง๋ค ์ฌ๋ฐ๋ฅธ path\entrypoint๋ฅผ ์ ๋ฌํด์ผ ํฉ๋๋ค. |
|
|
|
|
|
|
|
|
๊ทธ ๋ค์ ์ฑ์ ๋ฐฐํฌํฉ๋๋ค: |
|
|
๋ํ ๋ค๋ฅธ ๋๊ตฌ๋ค, ์๋ฅผ ๋ค์ด [VS Code ํ์ฅ](../editor-support.md)์ด๋ [FastAPI Cloud](https://fastapicloud.com)๊ฐ ์ด๋ฅผ ์ฐพ์ง ๋ชปํ ์ ์์ผ๋ฏ๋ก, `pyproject.toml`์ `entrypoint`๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. |
|
|
|
|
|
|
|
|
|
|
|
### ์ฑ ๋ฐฐํฌํ๊ธฐ(์ ํ ์ฌํญ) { #deploy-your-app-optional } |
|
|
|
|
|
|
|
|
|
|
|
์ ํ์ ์ผ๋ก FastAPI ์ฑ์ [FastAPI Cloud](https://fastapicloud.com)์ ๋จ ํ ๋ฒ์ ๋ช
๋ น์ผ๋ก ๋ฐฐํฌํ ์ ์์ต๋๋ค. ๐ |
|
|
|
|
|
|
|
|
<div class="termy"> |
|
|
<div class="termy"> |
|
|
|
|
|
|
|
|
@ -226,6 +216,8 @@ Deploying to FastAPI Cloud... |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
CLI๊ฐ ์ฌ๋ฌ๋ถ์ FastAPI ์ ํ๋ฆฌ์ผ์ด์
์ ์๋์ผ๋ก ๊ฐ์งํ๊ณ ํด๋ผ์ฐ๋์ ๋ฐฐํฌํฉ๋๋ค. ๋ก๊ทธ์ธ๋์ด ์์ง ์๋ค๋ฉด ๋ธ๋ผ์ฐ์ ๊ฐ ์ด๋ ค ์ธ์ฆ ๊ณผ์ ์ ์๋ฃํฉ๋๋ค. |
|
|
|
|
|
|
|
|
์ด๊ฒ ์ ๋ถ์
๋๋ค! ์ด์ ํด๋น URL์์ ์ฑ์ ์ ๊ทผํ ์ ์์ต๋๋ค. โจ |
|
|
์ด๊ฒ ์ ๋ถ์
๋๋ค! ์ด์ ํด๋น URL์์ ์ฑ์ ์ ๊ทผํ ์ ์์ต๋๋ค. โจ |
|
|
|
|
|
|
|
|
## ๋จ๊ณ๋ณ ์์ฝ { #recap-step-by-step } |
|
|
## ๋จ๊ณ๋ณ ์์ฝ { #recap-step-by-step } |
|
|
@ -269,8 +261,7 @@ https://example.com/items/foo |
|
|
``` |
|
|
``` |
|
|
/items/foo |
|
|
/items/foo |
|
|
``` |
|
|
``` |
|
|
|
|
|
/// note | ์ฐธ๊ณ |
|
|
/// info | ์ ๋ณด |
|
|
|
|
|
|
|
|
|
|
|
"๊ฒฝ๋ก"๋ ์ผ๋ฐ์ ์ผ๋ก "์๋ํฌ์ธํธ" ๋๋ "๋ผ์ฐํธ"๋ผ๊ณ ๋ ๋ถ๋ฆฝ๋๋ค. |
|
|
"๊ฒฝ๋ก"๋ ์ผ๋ฐ์ ์ผ๋ก "์๋ํฌ์ธํธ" ๋๋ "๋ผ์ฐํธ"๋ผ๊ณ ๋ ๋ถ๋ฆฝ๋๋ค. |
|
|
|
|
|
|
|
|
@ -322,7 +313,7 @@ API๋ฅผ ์ค๊ณํ ๋ ์ผ๋ฐ์ ์ผ๋ก ํน์ ํ๋์ ์ํํ๊ธฐ ์ํด ํน์ |
|
|
* ๊ฒฝ๋ก `/` |
|
|
* ๊ฒฝ๋ก `/` |
|
|
* <dfn title="HTTP GET ๋ฉ์๋"><code>get</code> ์๋</dfn> ์ฌ์ฉ |
|
|
* <dfn title="HTTP GET ๋ฉ์๋"><code>get</code> ์๋</dfn> ์ฌ์ฉ |
|
|
|
|
|
|
|
|
/// info | `@decorator` ์ ๋ณด |
|
|
/// note | `@decorator` ์ ๋ณด |
|
|
|
|
|
|
|
|
์ด `@something` ๋ฌธ๋ฒ์ ํ์ด์ฌ์์ "๋ฐ์ฝ๋ ์ดํฐ"๋ผ ๋ถ๋ฆ
๋๋ค. |
|
|
์ด `@something` ๋ฌธ๋ฒ์ ํ์ด์ฌ์์ "๋ฐ์ฝ๋ ์ดํฐ"๋ผ ๋ถ๋ฆ
๋๋ค. |
|
|
|
|
|
|
|
|
|