You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[서브 응용 프로그램 - 마운트](sub-applications.md){.internal-link target=_blank}, [프록시 뒤편에서](behind-a-proxy.md){.internal-link target=_blank}에서 보았듯이 WSGI 응용 프로그램들을 다음과 같이 마운트 할 수 있습니다.
4
+
5
+
`WSGIMiddleware`를 사용하여 WSGI 응용 프로그램(예: Flask, Django 등)을 감쌀 수 있습니다.
6
+
7
+
## `WSGIMiddleware` 사용하기
8
+
9
+
`WSGIMiddleware`를 불러와야 합니다.
10
+
11
+
그런 다음, WSGI(예: Flask) 응용 프로그램을 미들웨어로 포장합니다.
12
+
13
+
그 후, 해당 경로에 마운트합니다.
14
+
15
+
```Python hl_lines="2-3 23"
16
+
{!../../docs_src/wsgi/tutorial001.py!}
17
+
```
18
+
19
+
## 확인하기
20
+
21
+
이제 `/v1/` 경로에 있는 모든 요청은 Flask 응용 프로그램에서 처리됩니다.
22
+
23
+
그리고 나머지는 **FastAPI**에 의해 처리됩니다.
24
+
25
+
실행하면 <ahref="http://localhost:8000/v1/"class="external-link"target="_blank">http://localhost:8000/v1/</a>으로 이동해서 Flask의 응답을 볼 수 있습니다:
26
+
27
+
```txt
28
+
Hello, World from Flask!
29
+
```
30
+
31
+
그리고 다음으로 이동하면 <ahref="http://localhost:8000/v2"class="external-link"target="_blank">http://localhost:8000/v2</a> Flask의 응답을 볼 수 있습니다:
0 commit comments