Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for root_path (0.2 sec)

  1. 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` 传递给应用。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  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!}
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  3. docs/pt/docs/advanced/behind-a-proxy.md

    Se você usar Hypercorn, ele também tem a opção `--root-path`.
    
    /// note | "Detalhes Técnicos"
    
    A especificação ASGI define um `root_path` para esse caso de uso.
    
    E a opção de linha de comando `--root-path` fornece esse `root_path`.
    
    ///
    
    ### Verificando o `root_path` atual
    
    Você pode obter o `root_path` atual usado pela sua aplicação para cada solicitação, ele faz parte do dicionário `scope` (que faz parte da especificação ASGI).
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 15:28:18 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  4. 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):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jun 11 21:53:19 UTC 2020
    - 208 bytes
    - Viewed (0)
  5. 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):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 10 17:28:18 UTC 2020
    - 437 bytes
    - Viewed (0)
  6. 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`
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 13.1K bytes
    - Viewed (0)
  7. docs/zh/docs/advanced/sub-applications.md

    <img src="/img/tutorial/sub-applications/image02.png">
    
    两个用户界面都可以正常运行,因为浏览器能够与每个指定的应用或子应用会话。
    
    ### 技术细节:`root_path`
    
    以上述方式挂载子应用时,FastAPI 使用 ASGI 规范中的 `root_path` 机制处理挂载子应用路径之间的通信。
    
    这样,子应用就可以为自动文档使用路径前缀。
    
    并且子应用还可以再挂载子应用,一切都会正常运行,FastAPI 可以自动处理所有 `root_path`。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  8. 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`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  9. 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).
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 16:49:49 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  10. 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):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 10 17:28:18 UTC 2020
    - 405 bytes
    - Viewed (0)
Back to top