Function dispatchByPattern

  • Dispatches request processing by matching route pattern.

    Builds a route processing handler that dispatcher to route handler(s) corresponding to pattern the route matches.

    Selects the first matching pattern and delegates request processing to its handler. If the handler not responded, then tries the next matching pattern, and so on until responded or no routes left.

    Type Parameters

    • TRoute extends PathRoute

      A type of supported route.

    • TMeans extends RouterMeans<TRoute>

      A type of route processing means.

    Parameters

    • routes: DispatchPattern<TRoute, TMeans> | Iterable<DispatchPattern<TRoute, TMeans>>

      Either a routing dispatch pattern, or iterable of routing dispatch patterns.

    Returns RequestHandler<TMeans>

    Route processing handler.

Generated using TypeDoc