Class that defines a group of Routes in the application, with a prefix.

Hierarchy

Constructors

  • Parameters

    • group: (() => void | Promise<void>)

      Function to register routes for this group.

        • (): void | Promise<void>
        • Function to register routes for this group.

          Returns void | Promise<void>

    • prefix: string

      The route prefix of this group.

    Returns RouteGroup

Properties

group: (() => void | Promise<void>)

Type declaration

    • (): void | Promise<void>
    • Function to register routes for this group.

      Returns void | Promise<void>

postflight: Collection<Instantiable<Middleware>> = ...
prefix: string

The route prefix of this group.

currentGroupNesting: RouteGroup[] = []

The current set of nested groups. This is used when compiling route groups.

namedGroups: {
    [key: string]: (() => void);
} = {}

Mapping of group names to group registration functions.

Type declaration

  • [key: string]: (() => void)
      • (): void
      • Returns void

Accessors

Methods

  • Get the method with the given name from this class, bound to this class.

    Returns

    function

    Parameters

    • methodName: string

    Returns ((...args: any[]) => any)

      • (...args: any[]): any
      • Get the method with the given name from this class, bound to this class.

        Returns

        function

        Parameters

        • Rest ...args: any[]

        Returns any

  • Call the make() method on the global container.

    Type Parameters

    • T

    Parameters

    • target: any
    • Rest ...parameters: any[]

    Returns T

  • Register the routes from a named group by calling its registration function.

    Example

    From the example above, we can register the auth /auth/* routes, like so:

    RouteGroup.include('auth')
    

    Parameters

    • name: string

    Returns void

  • Create a new named group that can be registered at a later time, by name.

    Example

    RouteGroup.named('auth', () => {
    Route.group('/auth', () => {
    Route.get('/login', 'auth:Forms.getLogin')
    })
    })

    Parameters

    • name: string
    • define: (() => void)
        • (): void
        • Returns void

    Returns void