Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for add_middleware (0.07 sec)

  1. docs/en/docs/advanced/middleware.md

    For that, you use `app.add_middleware()` (as in the example for CORS).
    
    ```Python
    from fastapi import FastAPI
    from unicorn import UnicornMiddleware
    
    app = FastAPI()
    
    app.add_middleware(UnicornMiddleware, some_config="rainbow")
    ```
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:59:07 UTC 2025
    - 4.3K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/middleware.md

    On the request path, the *outermost* middleware runs first.
    
    On the response path, it runs last.
    
    For example:
    
    ```Python
    app.add_middleware(MiddlewareA)
    app.add_middleware(MiddlewareB)
    ```
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 4.1K bytes
    - Viewed (0)
Back to top