Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for websocket_route (0.16 sec)

  1. tests/test_ws_router.py

    router = APIRouter()
    prefix_router = APIRouter()
    native_prefix_route = APIRouter(prefix="/native")
    app = FastAPI()
    
    
    @app.websocket_route("/")
    async def index(websocket: WebSocket):
        await websocket.accept()
        await websocket.send_text("Hello, world!")
        await websocket.close()
    
    
    @router.websocket_route("/router")
    async def routerindex(websocket: WebSocket):
        await websocket.accept()
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 11 19:08:14 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  2. fastapi/routing.py

                self.add_api_websocket_route(
                    path, func, name=name, dependencies=dependencies
                )
                return func
    
            return decorator
    
        def websocket_route(
            self, path: str, name: Union[str, None] = None
        ) -> Callable[[DecoratedCallable], DecoratedCallable]:
            def decorator(func: DecoratedCallable) -> DecoratedCallable:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:44:57 UTC 2024
    - 172.1K bytes
    - Viewed (0)
  3. fastapi/applications.py

                name=name,
                callbacks=callbacks,
                openapi_extra=openapi_extra,
                generate_unique_id_function=generate_unique_id_function,
            )
    
        def websocket_route(
            self, path: str, name: Union[str, None] = None
        ) -> Callable[[DecoratedCallable], DecoratedCallable]:
            def decorator(func: DecoratedCallable) -> DecoratedCallable:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 17 04:52:31 UTC 2024
    - 172.2K bytes
    - Viewed (0)
  4. docs/en/docs/release-notes.md

    * Add support for `.websocket_route()` in `APIRouter`. PR [#100](https://github.com/tiangolo/fastapi/pull/100) by [@euri10](https://github.com/euri10).
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Nov 01 11:25:57 UTC 2024
    - 460.3K bytes
    - Viewed (0)
Back to top