Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for root_path (0.04 sec)

  1. 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")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  2. docs_src/behind_a_proxy/tutorial001_py39.py

    from fastapi import FastAPI, Request
    
    app = FastAPI()
    
    
    @app.get("/app")
    def read_main(request: Request):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 189 bytes
    - Viewed (0)
  3. docs/es/docs/advanced/sub-applications.md

    ### Detalles Técnicos: `root_path` { #technical-details-root-path }
    
    Cuando montas una sub-aplicación como se describe arriba, FastAPI se encargará de comunicar el path de montaje para la sub-aplicación usando un mecanismo de la especificación ASGI llamado `root_path`.
    
    De esa manera, la sub-aplicación sabrá usar ese prefijo de path para la interfaz de documentación.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  4. docs/pt/docs/advanced/sub-applications.md

    ### Detalhes Técnicos: `root_path` { #technical-details-root-path }
    
    Quando você monta uma sub-aplicação como descrito acima, o FastAPI se encarrega de comunicar o path de montagem para a sub-aplicação usando um mecanismo da especificação ASGI chamado `root_path`.
    
    Dessa forma, a sub-aplicação saberá usar esse prefixo de path para a interface de documentação.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  5. 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 Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  6. docs_src/behind_a_proxy/tutorial002_py39.py

    from fastapi import FastAPI, Request
    
    app = FastAPI(root_path="/api/v1")
    
    
    @app.get("/app")
    def read_main(request: Request):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 208 bytes
    - Viewed (0)
  7. docs_src/behind_a_proxy/tutorial003_py39.py

            {"url": "https://prod.example.com", "description": "Production environment"},
        ],
        root_path="/api/v1",
    )
    
    
    @app.get("/app")
    def read_main(request: Request):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 405 bytes
    - Viewed (0)
  8. docs_src/behind_a_proxy/tutorial004_py39.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 Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 437 bytes
    - Viewed (0)
  9. docs/ru/docs/advanced/sub-applications.md

    ### Технические подробности: `root_path` { #technical-details-root-path }
    
    Когда вы монтируете подприложение, как описано выше, FastAPI позаботится о передаче пути монтирования для подприложения, используя механизм из спецификации ASGI под названием `root_path`.
    
    Таким образом подприложение будет знать, что для интерфейса документации нужно использовать этот префикс пути.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.8K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.behind_a_proxy.tutorial001_py39 import app
    
    client = TestClient(app, root_path="/api/v1")
    
    
    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")
        assert response.status_code == 200
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1K bytes
    - Viewed (0)
Back to top