Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for root_path (0.19 sec)

  1. docs/en/docs/advanced/behind-a-proxy.md

    If you use Hypercorn, it also has the option `--root-path`.
    
    !!! note "Technical Details"
        The ASGI specification defines a `root_path` for this use case.
    
        And the `--root-path` command line option provides that `root_path`.
    
    ### Checking the current `root_path`
    
    You can get the current `root_path` used by your application for each request, it is part of the `scope` dictionary (that's part of the ASGI spec).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.6K bytes
    - Viewed (2)
  2. docs/em/docs/advanced/behind-a-proxy.md

    ```
    
    </div>
    
    🚥 👆 ⚙️ Hypercorn, ⚫️ ✔️ 🎛 `--root-path`.
    
    !!! note "📡 ℹ"
        🔫 🔧 🔬 `root_path` 👉 ⚙️ 💼.
    
         &amp; `--root-path` 📋 ⏸ 🎛 🚚 👈 `root_path`.
    
    ### ✅ ⏮️ `root_path`
    
    👆 💪 🤚 ⏮️ `root_path` ⚙️ 👆 🈸 🔠 📨, ⚫️ 🍕 `scope` 📖 (👈 🍕 🔫 🔌).
    
    📥 👥 ✅ ⚫️ 📧 🎦 🎯.
    
    ```Python hl_lines="8"
    {!../../../docs_src/behind_a_proxy/tutorial001.py!}
    ```
    
    ⤴️, 🚥 👆 ▶️ Uvicorn ⏮️:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/behind-a-proxy.md

    ```JSON
    {
        "message": "Hello World",
        "root_path": "/api/v1"
    }
    ```
    
    ### 在 FastAPI 应用里设置 `root_path`
    
    还有一种方案,如果不能提供 `--root-path` 或等效的命令行选项,则在创建 FastAPI 应用时要设置 `root_path` 参数。
    
    ```Python hl_lines="3"
    {!../../../docs_src/behind_a_proxy/tutorial002.py!}
    ```
    
    传递 `root_path` 给 `FastAPI` 与传递 `--root-path` 命令行选项给 Uvicorn 或 Hypercorn 一样。
    
    ### 关于 `root_path`
    
    注意,服务器(Uvicorn)只是把 `root_path` 传递给应用。
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  4. docs_src/behind_a_proxy/tutorial004.py

            {"url": "https://prod.example.com", "description": "Production environment"},
        ],
        root_path="/api/v1",
        root_path_in_servers=False,
    )
    
    
    @app.get("/app")
    def read_main(request: Request):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 10 17:28:18 GMT 2020
    - 437 bytes
    - Viewed (0)
  5. docs_src/behind_a_proxy/tutorial003.py

            {"url": "https://prod.example.com", "description": "Production environment"},
        ],
        root_path="/api/v1",
    )
    
    
    @app.get("/app")
    def read_main(request: Request):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 10 17:28:18 GMT 2020
    - 405 bytes
    - Viewed (0)
  6. docs_src/behind_a_proxy/tutorial002.py

    from fastapi import FastAPI, Request
    
    app = FastAPI(root_path="/api/v1")
    
    
    @app.get("/app")
    def read_main(request: Request):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jun 11 21:53:19 GMT 2020
    - 208 bytes
    - Viewed (0)
  7. docs/de/docs/advanced/behind-a-proxy.md

    !!! note "Technische Details"
        Die ASGI-Spezifikation definiert einen `root_path` für diesen Anwendungsfall.
    
        Und die Kommandozeilenoption `--root-path` stellt diesen `root_path` bereit.
    
    ### Überprüfen des aktuellen `root_path`
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:30:07 GMT 2024
    - 13.1K bytes
    - Viewed (0)
  8. tests/test_deprecated_openapi_prefix.py

    
    @app.get("/app")
    def read_main(request: Request):
        return {"message": "Hello World", "root_path": request.scope.get("root_path")}
    
    
    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello World", "root_path": "/api/v1"}
    
    
    def test_openapi():
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  9. docs/de/docs/advanced/sub-applications.md

    ### Technische Details: `root_path`
    
    Wenn Sie eine Unteranwendung wie oben beschrieben mounten, kümmert sich FastAPI darum, den Mount-Pfad für die Unteranwendung zu kommunizieren, mithilfe eines Mechanismus aus der ASGI-Spezifikation namens `root_path`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:18:06 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  10. docs/fa/docs/advanced/sub-applications.md

    ### جرئیات فنی : `root_path`
    
    هنگامی که یک زیر برنامه را همانطور که در بالا توضیح داده شد متصل می کنید, FastAPI با استفاده از مکانیزمی از مشخصات ASGI به نام `root_path` ارتباط مسیر mount را برای زیر برنامه انجام می دهد.
    
    به این ترتیب، زیر برنامه می داند که از آن پیشوند مسیر برای رابط کاربری اسناد (docs UI) استفاده کند.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
Back to top