Interface Routing<TInput, TRoute>

Request routing capability.

Provides request routing means for handlers.

Type Parameters

  • TInput = HttpMeans

    A type of request processing means required in order to apply this capability.

  • TRoute extends PathRoute = URLRoute

    Supported route type.

Hierarchy

  • RequestCapability<TInput, RouterMeans<TRoute>>
    • Routing

Methods

Methods

  • Combines this capability with the next one.

    Type Parameters

    • TNext

      A type of extension to request processing means applied by next capability.

    Parameters

    • next: RequestCapability<TInput & RouterMeans<TRoute>, TNext>

      Next capability that receives requests modified by this capability.

    Returns RequestCapability<TInput, RouterMeans<TRoute> & TNext>

    New request processing capability that applies modifications to request by this capability first, and then - by the next one.

    See

    RequestCapability.combine

  • Provides request processing capability to the given handler.

    Builds request processing handler that modifies request and delegates to target handler.

    Type Parameters

    • TMeans

      A type of request processing means expected by constructed handler.

    Parameters

    • handler: RequestHandler<TMeans & RouterMeans<TRoute>>

      Request processing handler that will receive modified request context.

    Returns RequestHandler<TMeans>

    New request processing handler.

  • Configures routing capability that constructs a route by incoming HTTP request.

    Type Parameters

    • TInput extends HttpMeans<IncomingMessage, ServerResponse<IncomingMessage>>

    Parameters

    • config: DefaultRoute<TInput, URLRoute>

      Router configuration without route build.

    Returns Routing<TInput, URLRoute>

    New request routing capability.

  • Configures routing capability with custom route builder.

    Type Parameters

    • TInput

    • TRoute extends PathRoute

    Parameters

    • config: CustomRoute<TInput, TRoute>

      Route configuration with custom route builder.

    Returns Routing<TInput, TRoute>

    New request routing capability.

Generated using TypeDoc