Skip to content

xtr_http_kernel.command

Console commands the http kernel bundle contributes when a console is active.

DebugRouterCommand

DebugRouterCommand(config: HttpKernelConfig)

Bases: RouterCommand

Lists every route an application holds, in the order routing tries them.

RouteDescription dataclass

RouteDescription(methods: str, path: str, name: str, endpoint: str)

One line of what a router holds, ready to be printed.

Built from the routing layer's own view of a route, so the path is the one requests are matched against — an included router's prefix already applied — rather than the one written at the endpoint.

Attributes:

  • methods (str) –

    The methods the route answers, comma-separated; WEBSOCKET for a connection route, MOUNT for a mounted application, - for a route taking whatever arrives.

  • path (str) –

    The path as routing reads it.

  • name (str) –

    The name the route answers to, empty when it has none.

  • endpoint (str) –

    What the route hands the request to, as module:qualname.

of classmethod

of(view: RouteView) -> RouteDescription

Describe the route view stands for.

RouterMatchCommand

RouterMatchCommand(config: HttpKernelConfig)

Bases: RouterCommand

Names the route a path and a method reach, without serving anything.

The routes are tried against a request that is built and thrown away — nothing is sent, no endpoint runs, and the application is left as it was.