Thanks to visit codestin.com
Credit goes to github.com

Skip to content
18 changes: 9 additions & 9 deletions docs/ko/docs/_llm-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* λ²ˆμ—­μ—μ„œ λ¬Έμ œκ°€ μ—†λŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€.
* ν•„μš”ν•˜λ‹€λ©΄ 언어별 ν”„λ‘¬ν”„νŠΈ, 일반 ν”„λ‘¬ν”„νŠΈ, λ˜λŠ” μ˜μ–΄ λ¬Έμ„œλ₯Ό κ°œμ„ ν•©λ‹ˆλ‹€.
* 그런 λ‹€μŒ λ²ˆμ—­μ—μ„œ 남아 μžˆλŠ” 문제λ₯Ό μˆ˜λ™μœΌλ‘œ μˆ˜μ •ν•΄ 쒋은 λ²ˆμ—­μ΄ 되게 ν•©λ‹ˆλ‹€.
* 쒋은 λ²ˆμ—­μ„ λ‘” μƒνƒœμ—μ„œ λ‹€μ‹œ λ²ˆμ—­ν•©λ‹ˆλ‹€. 이상적인 κ²°κ³ΌλŠ” LLM이 더 이상 λ²ˆμ—­μ— 변경을 λ§Œλ“€μ§€ μ•ŠλŠ” κ²ƒμž…λ‹ˆλ‹€. μ΄λŠ” 일반 ν”„λ‘¬ν”„νŠΈμ™€ 언어별 ν”„λ‘¬ν”„νŠΈκ°€ κ°€λŠ₯ν•œ ν•œ μ΅œμ„ μ΄λΌλŠ” λœ»μž…λ‹ˆλ‹€(λ•Œλ•Œλ‘œ λͺ‡ κ°€μ§€ seemingly random 변경을 ν•  수 μžˆλŠ”λ°, κ·Έ μ΄μœ λŠ” <a href="https://doublespeak.chat/#/handbook#deterministic-output" class="external-link" target="_blank">LLM은 결정둠적 μ•Œκ³ λ¦¬μ¦˜μ΄ μ•„λ‹ˆκΈ° λ•Œλ¬Έ</a>μž…λ‹ˆλ‹€).
* 쒋은 λ²ˆμ—­μ„ λ‘” μƒνƒœμ—μ„œ λ‹€μ‹œ λ²ˆμ—­ν•©λ‹ˆλ‹€. 이상적인 κ²°κ³ΌλŠ” LLM이 더 이상 λ²ˆμ—­μ— 변경을 λ§Œλ“€μ§€ μ•ŠλŠ” κ²ƒμž…λ‹ˆλ‹€. μ΄λŠ” 일반 ν”„λ‘¬ν”„νŠΈμ™€ 언어별 ν”„λ‘¬ν”„νŠΈκ°€ κ°€λŠ₯ν•œ ν•œ μ΅œμ„ μ΄λΌλŠ” λœ»μž…λ‹ˆλ‹€(λ•Œλ•Œλ‘œ λͺ‡ κ°€μ§€ seemingly random 변경을 ν•  수 μžˆλŠ”λ°, κ·Έ μ΄μœ λŠ” [LLM은 결정둠적 μ•Œκ³ λ¦¬μ¦˜μ΄ μ•„λ‹ˆκΈ° λ•Œλ¬Έ](https://doublespeak.chat/#/handbook#deterministic-output)μž…λ‹ˆλ‹€).

ν…ŒμŠ€νŠΈ:

Expand Down Expand Up @@ -169,15 +169,15 @@ works(foo="bar") # 이건 λ™μž‘ν•©λ‹ˆλ‹€ πŸŽ‰
링크 ν…μŠ€νŠΈλŠ” λ²ˆμ—­λ˜μ–΄μ•Ό ν•˜κ³ , 링크 μ£Όμ†ŒλŠ” λ³€κ²½λ˜μ§€ μ•Šμ•„μ•Ό ν•©λ‹ˆλ‹€:

* [μœ„μ˜ 제λͺ©μœΌλ‘œ κ°€λŠ” 링크](#code-snippets)
* [λ‚΄λΆ€ 링크](index.md#installation){.internal-link target=_blank}
* <a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">μ™ΈλΆ€ 링크</a>
* <a href="https://fastapi.tiangolo.com/css/styles.css" class="external-link" target="_blank">μŠ€νƒ€μΌλ‘œ κ°€λŠ” 링크</a>
* <a href="https://fastapi.tiangolo.com/js/logic.js" class="external-link" target="_blank">슀크립트둜 κ°€λŠ” 링크</a>
* <a href="https://fastapi.tiangolo.com/img/foo.jpg" class="external-link" target="_blank">μ΄λ―Έμ§€λ‘œ κ°€λŠ” 링크</a>
* [λ‚΄λΆ€ 링크](index.md#installation)
* [μ™ΈλΆ€ 링크](https://sqlmodel.tiangolo.com/)
* [μŠ€νƒ€μΌλ‘œ κ°€λŠ” 링크](https://fastapi.tiangolo.com/css/styles.css)
* [슀크립트둜 κ°€λŠ” 링크](https://fastapi.tiangolo.com/js/logic.js)
* [μ΄λ―Έμ§€λ‘œ κ°€λŠ” 링크](https://fastapi.tiangolo.com/img/foo.jpg)

링크 ν…μŠ€νŠΈλŠ” λ²ˆμ—­λ˜μ–΄μ•Ό ν•˜κ³ , 링크 μ£Όμ†ŒλŠ” λ²ˆμ—­ νŽ˜μ΄μ§€λ₯Ό κ°€λ¦¬μΌœμ•Ό ν•©λ‹ˆλ‹€:

* <a href="https://fastapi.tiangolo.com/ko/" class="external-link" target="_blank">FastAPI 링크</a>
* [FastAPI 링크](https://fastapi.tiangolo.com/ko/)

////

Expand Down Expand Up @@ -259,8 +259,8 @@ works(foo="bar") # 이건 λ™μž‘ν•©λ‹ˆλ‹€ πŸŽ‰
* μ—¬λŸ¬λΆ„
* μ—¬λŸ¬λΆ„μ˜

* 예: (e.g.)
* λ“± (etc.)
* 예:
* λ“±

* `foo`λ‘œμ„œμ˜ `int`
* `bar`λ‘œμ„œμ˜ `str`
Expand Down
4 changes: 2 additions & 2 deletions docs/ko/docs/advanced/additional-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,5 @@ new_dict = {**old_dict, "new key": "new value"}

응닡에 μ •ν™•νžˆ 무엇을 포함할 수 μžˆλŠ”μ§€ 보렀면, OpenAPI μ‚¬μ–‘μ˜ λ‹€μŒ μ„Ήμ…˜μ„ ν™•μΈν•˜μ„Έμš”:

* <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#responses-object" class="external-link" target="_blank">OpenAPI Responses Object</a>: `Response Object`λ₯Ό ν¬ν•¨ν•©λ‹ˆλ‹€.
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#response-object" class="external-link" target="_blank">OpenAPI Response Object</a>: `responses` νŒŒλΌλ―Έν„° μ•ˆμ˜ 각 응닡에 μ΄κ²ƒμ˜ μ–΄λ–€ ν•­λͺ©μ΄λ“  직접 포함할 수 μžˆμŠ΅λ‹ˆλ‹€. `description`, `headers`, `content`(μ—¬κΈ°μ—μ„œ μ„œλ‘œ λ‹€λ₯Έ λ―Έλ””μ–΄ νƒ€μž…κ³Ό JSON Schemaλ₯Ό μ„ μ–Έν•©λ‹ˆλ‹€), `links` 등을 포함할 수 μžˆμŠ΅λ‹ˆλ‹€.
* [OpenAPI Responses Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#responses-object): `Response Object`λ₯Ό ν¬ν•¨ν•©λ‹ˆλ‹€.
* [OpenAPI Response Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#response-object): `responses` νŒŒλΌλ―Έν„° μ•ˆμ˜ 각 응닡에 μ΄κ²ƒμ˜ μ–΄λ–€ ν•­λͺ©μ΄λ“  직접 포함할 수 μžˆμŠ΅λ‹ˆλ‹€. `description`, `headers`, `content`(μ—¬κΈ°μ—μ„œ μ„œλ‘œ λ‹€λ₯Έ λ―Έλ””μ–΄ νƒ€μž…κ³Ό JSON Schemaλ₯Ό μ„ μ–Έν•©λ‹ˆλ‹€), `links` 등을 포함할 수 μžˆμŠ΅λ‹ˆλ‹€.
2 changes: 1 addition & 1 deletion docs/ko/docs/advanced/additional-status-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@

μΆ”κ°€ μƒνƒœ μ½”λ“œμ™€ 응닡을 직접 λ°˜ν™˜ν•˜λŠ” 경우, FastAPIλŠ” λ°˜ν™˜ν•  λ‚΄μš©μ„ 미리 μ•Œ 수 μžˆλŠ” 방법이 μ—†κΈ° λ•Œλ¬Έμ— OpenAPI μŠ€ν‚€λ§ˆ(API λ¬Έμ„œ)에 ν¬ν•¨λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

ν•˜μ§€λ§Œ λ‹€μŒμ„ μ‚¬μš©ν•˜μ—¬ μ½”λ“œμ— 이λ₯Ό λ¬Έμ„œν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€: [μΆ”κ°€ 응닡](additional-responses.md){.internal-link target=_blank}.
ν•˜μ§€λ§Œ λ‹€μŒμ„ μ‚¬μš©ν•˜μ—¬ μ½”λ“œμ— 이λ₯Ό λ¬Έμ„œν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€: [μΆ”κ°€ 응닡](additional-responses.md).
4 changes: 2 additions & 2 deletions docs/ko/docs/advanced/advanced-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ SQLModel(λ˜λŠ” SQLAlchemy)을 μ‚¬μš©ν•˜λ©΄μ„œ 이런 νŠΉμ • μ‚¬μš© 사둀가

그러면 μ„Έμ…˜μ΄ λ°μ΄ν„°λ² μ΄μŠ€ 연결을 ν•΄μ œν•˜μ—¬, λ‹€λ₯Έ μš”μ²­λ“€μ΄ 이λ₯Ό μ‚¬μš©ν•  수 있게 λ©λ‹ˆλ‹€.

`yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±μ—μ„œ μ‘°κΈ° μ’…λ£Œκ°€ ν•„μš”ν•œ λ‹€λ₯Έ μ‚¬μš© 사둀가 μžˆλ‹€λ©΄, μ—¬λŸ¬λΆ„μ˜ ꡬ체적인 μ‚¬μš© 사둀와 `yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±μ— λŒ€ν•œ μ‘°κΈ° μ’…λ£Œκ°€ μ–΄λ–€ μ μ—μ„œ 이득이 λ˜λŠ”μ§€λ₯Ό 포함해 <a href="https://github.com/fastapi/fastapi/discussions/new?category=questions" class="external-link" target="_blank">GitHub Discussions 질문</a>을 생성해 μ£Όμ„Έμš”.
`yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±μ—μ„œ μ‘°κΈ° μ’…λ£Œκ°€ ν•„μš”ν•œ λ‹€λ₯Έ μ‚¬μš© 사둀가 μžˆλ‹€λ©΄, μ—¬λŸ¬λΆ„μ˜ ꡬ체적인 μ‚¬μš© 사둀와 `yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±μ— λŒ€ν•œ μ‘°κΈ° μ’…λ£Œκ°€ μ–΄λ–€ μ μ—μ„œ 이득이 λ˜λŠ”μ§€λ₯Ό 포함해 [GitHub Discussions 질문](https://github.com/fastapi/fastapi/discussions/new?category=questions)을 생성해 μ£Όμ„Έμš”.

`yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±μ—μ„œ μ‘°κΈ° μ’…λ£Œμ— λŒ€ν•œ 섀득λ ₯ μžˆλŠ” μ‚¬μš© 사둀가 μžˆλ‹€λ©΄, μ‘°κΈ° μ’…λ£Œλ₯Ό μ„ νƒμ μœΌλ‘œ ν™œμ„±ν™”ν•  수 μžˆλŠ” μƒˆλ‘œμš΄ 방법을 μΆ”κ°€ν•˜λŠ” 것을 κ³ λ €ν•˜κ² μŠ΅λ‹ˆλ‹€.

Expand All @@ -145,7 +145,7 @@ FastAPI 0.110.0 μ΄μ „μ—λŠ” `yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±μ„ μ‚¬μš©ν•œ λ‹€μŒ κ·Έ

### λ°±κ·ΈλΌμš΄λ“œ νƒœμŠ€ν¬μ™€ `yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±, 기술 세뢀사항 { #background-tasks-and-dependencies-with-yield-technical-details }

FastAPI 0.106.0 μ΄μ „μ—λŠ” `yield` 이후에 μ˜ˆμ™Έλ₯Ό λ°œμƒμ‹œν‚€λŠ” 것이 λΆˆκ°€λŠ₯ν–ˆμŠ΅λ‹ˆλ‹€. `yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±μ˜ μ’…λ£Œ μ½”λ“œλŠ” 응닡이 μ „μ†‘λœ *후에* μ‹€ν–‰λ˜μ—ˆκΈ° λ•Œλ¬Έμ—, [μ˜ˆμ™Έ ν•Έλ“€λŸ¬](../tutorial/handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}κ°€ 이미 μ‹€ν–‰λœ λ’€μ˜€μŠ΅λ‹ˆλ‹€.
FastAPI 0.106.0 μ΄μ „μ—λŠ” `yield` 이후에 μ˜ˆμ™Έλ₯Ό λ°œμƒμ‹œν‚€λŠ” 것이 λΆˆκ°€λŠ₯ν–ˆμŠ΅λ‹ˆλ‹€. `yield`κ°€ μžˆλŠ” μ˜μ‘΄μ„±μ˜ μ’…λ£Œ μ½”λ“œλŠ” 응닡이 μ „μ†‘λœ *후에* μ‹€ν–‰λ˜μ—ˆκΈ° λ•Œλ¬Έμ—, [μ˜ˆμ™Έ ν•Έλ“€λŸ¬](../tutorial/handling-errors.md#install-custom-exception-handlers)κ°€ 이미 μ‹€ν–‰λœ λ’€μ˜€μŠ΅λ‹ˆλ‹€.

μ΄λŠ” 주둜 λ°±κ·ΈλΌμš΄λ“œ νƒœμŠ€ν¬ μ•ˆμ—μ„œ μ˜μ‘΄μ„±μ΄ "yield"ν•œ λ™μΌν•œ 객체듀을 μ‚¬μš©ν•  수 있게 ν•˜κΈ° μœ„ν•œ μ„€κ³„μ˜€μŠ΅λ‹ˆλ‹€. λ°±κ·ΈλΌμš΄λ“œ νƒœμŠ€ν¬κ°€ λλ‚œ 뒀에 μ’…λ£Œ μ½”λ“œκ°€ μ‹€ν–‰λ˜μ—ˆκΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€.

Expand Down
8 changes: 4 additions & 4 deletions docs/ko/docs/advanced/async-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

`TestClient`λŠ” ν‘œμ€€ pytestλ₯Ό μ‚¬μš©ν•˜μ—¬, 일반 `def` ν…ŒμŠ€νŠΈ ν•¨μˆ˜ μ•ˆμ—μ„œ 비동기 FastAPI μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ ν˜ΈμΆœν•˜λ„λ‘ λ‚΄λΆ€μ—μ„œ λ§ˆλ²• 같은 처리λ₯Ό ν•©λ‹ˆλ‹€. ν•˜μ§€λ§Œ 비동기 ν•¨μˆ˜ μ•ˆμ—μ„œ 이λ₯Ό μ‚¬μš©ν•˜λ©΄ κ·Έ λ§ˆλ²•μ€ 더 이상 λ™μž‘ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. ν…ŒμŠ€νŠΈλ₯Ό λΉ„λ™κΈ°λ‘œ μ‹€ν–‰ν•˜λ©΄, ν…ŒμŠ€νŠΈ ν•¨μˆ˜ μ•ˆμ—μ„œ `TestClient`λ₯Ό 더 이상 μ‚¬μš©ν•  수 μ—†μŠ΅λ‹ˆλ‹€.

`TestClient`λŠ” <a href="https://www.python-httpx.org" class="external-link" target="_blank">HTTPX</a>λ₯Ό 기반으둜 ν•˜λ©°, λ‹€ν–‰νžˆ HTTPXλ₯Ό 직접 μ‚¬μš©ν•΄ APIλ₯Ό ν…ŒμŠ€νŠΈν•  수 μžˆμŠ΅λ‹ˆλ‹€.
`TestClient`λŠ” [HTTPX](https://www.python-httpx.org)λ₯Ό 기반으둜 ν•˜λ©°, λ‹€ν–‰νžˆ HTTPXλ₯Ό 직접 μ‚¬μš©ν•΄ APIλ₯Ό ν…ŒμŠ€νŠΈν•  수 μžˆμŠ΅λ‹ˆλ‹€.

## μ˜ˆμ‹œ { #example }

κ°„λ‹¨ν•œ μ˜ˆμ‹œλ‘œ, [더 큰 μ• ν”Œλ¦¬μΌ€μ΄μ…˜](../tutorial/bigger-applications.md){.internal-link target=_blank}κ³Ό [ν…ŒμŠ€νŠΈ](../tutorial/testing.md){.internal-link target=_blank}μ—μ„œ μ„€λͺ…ν•œ 것과 λΉ„μŠ·ν•œ 파일 ꡬ쑰λ₯Ό μ‚΄νŽ΄λ³΄κ² μŠ΅λ‹ˆλ‹€:
κ°„λ‹¨ν•œ μ˜ˆμ‹œλ‘œ, [더 큰 μ• ν”Œλ¦¬μΌ€μ΄μ…˜](../tutorial/bigger-applications.md)κ³Ό [ν…ŒμŠ€νŠΈ](../tutorial/testing.md)μ—μ„œ μ„€λͺ…ν•œ 것과 λΉ„μŠ·ν•œ 파일 ꡬ쑰λ₯Ό μ‚΄νŽ΄λ³΄κ² μŠ΅λ‹ˆλ‹€:

```
.
Expand Down Expand Up @@ -84,7 +84,7 @@ response = client.get('/')

/// warning | κ²½κ³ 

μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ lifespan μ΄λ²€νŠΈμ— μ˜μ‘΄ν•œλ‹€λ©΄, `AsyncClient`λŠ” μ΄λŸ¬ν•œ 이벀트λ₯Ό νŠΈλ¦¬κ±°ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ΄λ²€νŠΈκ°€ νŠΈλ¦¬κ±°λ˜λ„λ‘ ν•˜λ €λ©΄ <a href="https://github.com/florimondmanca/asgi-lifespan#usage" class="external-link" target="_blank">florimondmanca/asgi-lifespan</a>의 `LifespanManager`λ₯Ό μ‚¬μš©ν•˜μ„Έμš”.
μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ lifespan μ΄λ²€νŠΈμ— μ˜μ‘΄ν•œλ‹€λ©΄, `AsyncClient`λŠ” μ΄λŸ¬ν•œ 이벀트λ₯Ό νŠΈλ¦¬κ±°ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ΄λ²€νŠΈκ°€ νŠΈλ¦¬κ±°λ˜λ„λ‘ ν•˜λ €λ©΄ [florimondmanca/asgi-lifespan](https://github.com/florimondmanca/asgi-lifespan#usage)의 `LifespanManager`λ₯Ό μ‚¬μš©ν•˜μ„Έμš”.

///

Expand All @@ -94,6 +94,6 @@ response = client.get('/')

/// tip | 팁

ν…ŒμŠ€νŠΈμ— 비동기 ν•¨μˆ˜ ν˜ΈμΆœμ„ 톡합할 λ•Œ(예: <a href="https://stackoverflow.com/questions/41584243/runtimeerror-task-attached-to-a-different-loop" class="external-link" target="_blank">MongoDB의 MotorClient</a>λ₯Ό μ‚¬μš©ν•  λ•Œ) `RuntimeError: Task attached to a different loop`λ₯Ό λ§ˆμ£ΌμΉœλ‹€λ©΄, 이벀트 루프가 ν•„μš”ν•œ κ°μ²΄λŠ” async ν•¨μˆ˜ μ•ˆμ—μ„œλ§Œ μΈμŠ€ν„΄μŠ€ν™”ν•΄μ•Ό ν•œλ‹€λŠ” 점을 κΈ°μ–΅ν•˜μ„Έμš”. 예λ₯Ό λ“€μ–΄ `@app.on_event("startup")` μ½œλ°±μ—μ„œ μΈμŠ€ν„΄μŠ€ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
ν…ŒμŠ€νŠΈμ— 비동기 ν•¨μˆ˜ ν˜ΈμΆœμ„ 톡합할 λ•Œ(예: [MongoDB의 MotorClient](https://stackoverflow.com/questions/41584243/runtimeerror-task-attached-to-a-different-loop)λ₯Ό μ‚¬μš©ν•  λ•Œ) `RuntimeError: Task attached to a different loop`λ₯Ό λ§ˆμ£ΌμΉœλ‹€λ©΄, 이벀트 루프가 ν•„μš”ν•œ κ°μ²΄λŠ” async ν•¨μˆ˜ μ•ˆμ—μ„œλ§Œ μΈμŠ€ν„΄μŠ€ν™”ν•΄μ•Ό ν•œλ‹€λŠ” 점을 κΈ°μ–΅ν•˜μ„Έμš”. 예λ₯Ό λ“€μ–΄ `@app.on_event("startup")` μ½œλ°±μ—μ„œ μΈμŠ€ν„΄μŠ€ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

///
34 changes: 17 additions & 17 deletions docs/ko/docs/advanced/behind-a-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

ν”„λ‘μ‹œ ν—€λ”λŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:

* <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-For" class="external-link" target="_blank">X-Forwarded-For</a>
* <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Proto" class="external-link" target="_blank">X-Forwarded-Proto</a>
* <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Host" class="external-link" target="_blank">X-Forwarded-Host</a>
* [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-For)
* [X-Forwarded-Proto](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Proto)
* [X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Host)

///

Expand Down Expand Up @@ -60,7 +60,7 @@ https://mysuperapp.com/items/

/// tip | 팁

HTTPS에 λŒ€ν•΄ 더 μ•Œμ•„λ³΄λ €λ©΄ κ°€μ΄λ“œ [HTTPS에 λŒ€ν•˜μ—¬](../deployment/https.md){.internal-link target=_blank}λ₯Ό ν™•μΈν•˜μ„Έμš”.
HTTPS에 λŒ€ν•΄ 더 μ•Œμ•„λ³΄λ €λ©΄ κ°€μ΄λ“œ [HTTPS에 λŒ€ν•˜μ—¬](../deployment/https.md)λ₯Ό ν™•μΈν•˜μ„Έμš”.

///

Expand Down Expand Up @@ -149,14 +149,14 @@ IP `0.0.0.0`은 보톡 ν•΄λ‹Ή λ¨Έμ‹ /μ„œλ²„μ—μ„œ μ‚¬μš© κ°€λŠ₯ν•œ λͺ¨λ“  IP에
```JSON hl_lines="4-8"
{
"openapi": "3.1.0",
// More stuff here
// 여기에 λ‹€λ₯Έ λ‚΄μš©μ΄ 더 μžˆμŠ΅λ‹ˆλ‹€
"servers": [
{
"url": "/api/v1"
}
],
"paths": {
// More stuff here
// 여기에 λ‹€λ₯Έ λ‚΄μš©μ΄ 더 μžˆμŠ΅λ‹ˆλ‹€
}
}
```
Expand Down Expand Up @@ -228,7 +228,7 @@ $ fastapi run main.py --forwarded-allow-ips="*" --root-path /api/v1

μ„œλ²„(Uvicorn)λŠ” κ·Έ `root_path`λ₯Ό 앱에 μ „λ‹¬ν•˜λŠ” 것 μ™Έμ—λŠ” λ‹€λ₯Έ μš©λ„λ‘œ μ‚¬μš©ν•˜μ§€ μ•ŠλŠ”λ‹€λŠ” 점을 κΈ°μ–΅ν•˜μ„Έμš”.

ν•˜μ§€λ§Œ λΈŒλΌμš°μ €λ‘œ <a href="http://127.0.0.1:8000/app" class="external-link" target="_blank">http://127.0.0.1:8000/app</a>에 μ ‘μ†ν•˜λ©΄ 정상 응닡을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€:
ν•˜μ§€λ§Œ λΈŒλΌμš°μ €λ‘œ [http://127.0.0.1:8000/app](http://127.0.0.1:8000/app)에 μ ‘μ†ν•˜λ©΄ 정상 응닡을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€:

```JSON
{
Expand All @@ -251,9 +251,9 @@ Uvicorn은 ν”„λ‘μ‹œκ°€ `http://127.0.0.1:8000/app`μ—μ„œ Uvicorn에 μ ‘κ·Όν• 

## Traefik으둜 둜컬 ν…ŒμŠ€νŠΈν•˜κΈ° { #testing-locally-with-traefik }

<a href="https://docs.traefik.io/" class="external-link" target="_blank">Traefik</a>을 μ‚¬μš©ν•˜λ©΄, 경둜 접두사가 μ œκ±°λ˜λŠ” ꡬ성을 λ‘œμ»¬μ—μ„œ μ‰½κ²Œ μ‹€ν—˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
[Traefik](https://docs.traefik.io/)을 μ‚¬μš©ν•˜λ©΄, 경둜 접두사가 μ œκ±°λ˜λŠ” ꡬ성을 λ‘œμ»¬μ—μ„œ μ‰½κ²Œ μ‹€ν—˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

<a href="https://github.com/containous/traefik/releases" class="external-link" target="_blank">Traefik λ‹€μš΄λ‘œλ“œ</a>λŠ” 단일 λ°”μ΄λ„ˆλ¦¬μ΄λ©°, μ••μΆ• νŒŒμΌμ„ ν’€κ³  ν„°λ―Έλ„μ—μ„œ λ°”λ‘œ μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
[Traefik λ‹€μš΄λ‘œλ“œ](https://github.com/containous/traefik/releases)λŠ” 단일 λ°”μ΄λ„ˆλ¦¬μ΄λ©°, μ••μΆ• νŒŒμΌμ„ ν’€κ³  ν„°λ―Έλ„μ—μ„œ λ°”λ‘œ μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

κ·Έ λ‹€μŒ λ‹€μŒ λ‚΄μš©μ„ κ°€μ§„ `traefik.toml` νŒŒμΌμ„ μƒμ„±ν•˜μ„Έμš”:

Expand Down Expand Up @@ -330,7 +330,7 @@ $ fastapi run main.py --forwarded-allow-ips="*" --root-path /api/v1

### 응닡 ν™•μΈν•˜κΈ° { #check-the-responses }

이제 Uvicorn의 포트둜 된 URL인 <a href="http://127.0.0.1:8000/app" class="external-link" target="_blank">http://127.0.0.1:8000/app</a>둜 μ ‘μ†ν•˜λ©΄ 정상 응닡을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€:
이제 Uvicorn의 포트둜 된 URL인 [http://127.0.0.1:8000/app](http://127.0.0.1:8000/app)둜 μ ‘μ†ν•˜λ©΄ 정상 응닡을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€:

```JSON
{
Expand All @@ -345,7 +345,7 @@ $ fastapi run main.py --forwarded-allow-ips="*" --root-path /api/v1

///

이제 Traefik의 ν¬νŠΈκ°€ ν¬ν•¨λ˜κ³  경둜 접두사가 ν¬ν•¨λœ URL <a href="http://127.0.0.1:9999/api/v1/app" class="external-link" target="_blank">http://127.0.0.1:9999/api/v1/app</a>을 μ—¬μ„Έμš”.
이제 Traefik의 ν¬νŠΈκ°€ ν¬ν•¨λ˜κ³  경둜 접두사가 ν¬ν•¨λœ URL [http://127.0.0.1:9999/api/v1/app](http://127.0.0.1:9999/api/v1/app)을 μ—¬μ„Έμš”.

λ™μΌν•œ 응닡을 μ–»μŠ΅λ‹ˆλ‹€:

Expand All @@ -370,13 +370,13 @@ $ fastapi run main.py --forwarded-allow-ips="*" --root-path /api/v1

앱에 μ ‘κ·Όν•˜λŠ” "곡식" 방법은 μš°λ¦¬κ°€ μ •μ˜ν•œ 경둜 접두사λ₯Ό κ°€μ§„ ν”„λ‘μ‹œλ₯Ό ν†΅ν•΄μ„œμž…λ‹ˆλ‹€. λ”°λΌμ„œ κΈ°λŒ€ν•˜λŠ” λŒ€λ‘œ, URL에 경둜 접두사가 μ—†λŠ” μƒνƒœμ—μ„œ Uvicorn이 직접 μ œκ³΅ν•˜λŠ” docs UIλ₯Ό μ‹œλ„ν•˜λ©΄, ν”„λ‘μ‹œλ₯Ό 톡해 μ ‘κ·Όλœλ‹€κ³  κ°€μ •ν•˜κ³  있기 λ•Œλ¬Έμ— λ™μž‘ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

<a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€:
[http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€:

<img src="/img/tutorial/behind-a-proxy/image01.png">

ν•˜μ§€λ§Œ ν”„λ‘μ‹œ(포트 `9999`)λ₯Ό μ‚¬μš©ν•΄ "곡식" URL인 `/api/v1/docs`μ—μ„œ docs UI에 μ ‘κ·Όν•˜λ©΄, μ˜¬λ°”λ₯΄κ²Œ λ™μž‘ν•©λ‹ˆλ‹€! πŸŽ‰

<a href="http://127.0.0.1:9999/api/v1/docs" class="external-link" target="_blank">http://127.0.0.1:9999/api/v1/docs</a>μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€:
[http://127.0.0.1:9999/api/v1/docs](http://127.0.0.1:9999/api/v1/docs)μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€:

<img src="/img/tutorial/behind-a-proxy/image02.png">

Expand Down Expand Up @@ -407,7 +407,7 @@ $ fastapi run main.py --forwarded-allow-ips="*" --root-path /api/v1
```JSON hl_lines="5-7"
{
"openapi": "3.1.0",
// More stuff here
// 여기에 λ‹€λ₯Έ λ‚΄μš©μ΄ 더 μžˆμŠ΅λ‹ˆλ‹€
"servers": [
{
"url": "/api/v1"
Expand All @@ -422,7 +422,7 @@ $ fastapi run main.py --forwarded-allow-ips="*" --root-path /api/v1
}
],
"paths": {
// More stuff here
// 여기에 λ‹€λ₯Έ λ‚΄μš©μ΄ 더 μžˆμŠ΅λ‹ˆλ‹€
}
}
```
Expand All @@ -433,7 +433,7 @@ $ fastapi run main.py --forwarded-allow-ips="*" --root-path /api/v1

///

<a href="http://127.0.0.1:9999/api/v1/docs" class="external-link" target="_blank">http://127.0.0.1:9999/api/v1/docs</a>의 docs UIμ—μ„œλŠ” λ‹€μŒμ²˜λŸΌ λ³΄μž…λ‹ˆλ‹€:
[http://127.0.0.1:9999/api/v1/docs](http://127.0.0.1:9999/api/v1/docs)의 docs UIμ—μ„œλŠ” λ‹€μŒμ²˜λŸΌ λ³΄μž…λ‹ˆλ‹€:

<img src="/img/tutorial/behind-a-proxy/image03.png">

Expand Down Expand Up @@ -461,6 +461,6 @@ OpenAPI μ‚¬μ–‘μ—μ„œ `servers` 속성은 선택 μ‚¬ν•­μž…λ‹ˆλ‹€.

## μ„œλΈŒ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ λ§ˆμš΄νŠΈν•˜κΈ° { #mounting-a-sub-application }

ν”„λ‘μ‹œμ—μ„œ `root_path`λ₯Ό μ‚¬μš©ν•˜λ©΄μ„œλ„, [μ„œλΈŒ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ - 마운트](sub-applications.md){.internal-link target=_blank}에 μ„€λͺ…λœ κ²ƒμ²˜λŸΌ μ„œλΈŒ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ λ§ˆμš΄νŠΈν•΄μ•Ό ν•œλ‹€λ©΄, κΈ°λŒ€ν•˜λŠ” λŒ€λ‘œ 일반적으둜 μˆ˜ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
ν”„λ‘μ‹œμ—μ„œ `root_path`λ₯Ό μ‚¬μš©ν•˜λ©΄μ„œλ„, [μ„œλΈŒ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ - 마운트](sub-applications.md)에 μ„€λͺ…λœ κ²ƒμ²˜λŸΌ μ„œλΈŒ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ λ§ˆμš΄νŠΈν•΄μ•Ό ν•œλ‹€λ©΄, κΈ°λŒ€ν•˜λŠ” λŒ€λ‘œ 일반적으둜 μˆ˜ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

FastAPIκ°€ λ‚΄λΆ€μ μœΌλ‘œ `root_path`λ₯Ό λ˜‘λ˜‘ν•˜κ²Œ μ‚¬μš©ν•˜λ―€λ‘œ, κ·Έλƒ₯ λ™μž‘ν•©λ‹ˆλ‹€. ✨
Loading
Loading