bareasgi.basic_router
module bareasgi.basic_router.http_router ¶
Summary¶
Http Routing
class BasicHttpRouter(HttpRouter) ¶
Summary¶
A basic http routing implementation
bareasgi.basic_router.BasicHttpRouter(
not_found_response: HttpResponse
) -> Nonemethod BasicHttpRouter.add ¶
Summary¶
Add an HTTP request handler
BasicHttpRouter.add(
methods: AbstractSet[str],
path: str,
callback: HttpRequestCallback
) -> AnyParameters¶
methods: AbstractSet[str]The supported HTTP methods.
path: strThe path.
callback: HttpRequestCallbackThe request handler.
method BasicHttpRouter.add_route ¶
Summary¶
Add a route to a callback for a method and path definition
BasicHttpRouter.add_route(
method: str,
path_definition: PathDefinition,
callback: HttpRequestCallback
) -> AnyParameters¶
method: strThe method.
path_definition: PathDefinitionThe path definition
callback: HttpRequestCallbackThe callback
module bareasgi.basic_router.web_socket_router ¶
Summary¶
A basic Websocket router.
class BasicWebSocketRouter(WebSocketRouter) ¶
Summary¶
The implementation of a basic Websocket router
bareasgi.basic_router.BasicWebSocketRouter() -> None