Documentation
    Preparing search index...

    Class RouteResource<ActionNames>

    Route resource exposes the API to register multiple routes for a resource.

    Type Parameters

    Hierarchy

    • default
      • RouteResource
    Index

    Constructors

    Properties

    routes: Route<any>[] = []

    A collection of routes instances that belongs to this resource

    Methods

    • Define matcher for params inside the resource

      Parameters

      • key: string

        The parameter name to match

      • matcher: string | RegExp | RouteMatcher

        The matcher pattern (RegExp, string, or RouteMatcher)

      Returns this

      Current RouteResource instance for method chaining

    • Tap into multiple routes to configure them by their name

      Parameters

      • callback: (route: Route) => void

        Function to configure routes

      Returns this

      Current RouteResource instance for method chaining

    • Tap into multiple routes to configure them by their name

      Parameters

      Returns this

      Current RouteResource instance for method chaining

    • Set the param name for a given resource

      Parameters

      • resources: { [resource: string]: string }

        Object mapping resource names to parameter names

      Returns this

      Current RouteResource instance for method chaining

    • Prepend name to all the routes

      Parameters

      • name: string

        The name to prepend to all route names

      • normalizeName: boolean = true

        Whether to normalize the name to snake_case

      Returns this

      Current RouteResource instance for method chaining