Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

Index

Constructors

constructor

  • new RouteGroup(group: () => void | Promise<void>, prefix: string): RouteGroup

Properties

Readonly group

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

Type declaration

    • (): void | Promise<void>
    • Returns void | Promise<void>

Protected middlewares

middlewares: Collection<{ handler: RouteHandler; stage: "post" | "pre" }> = ...

Array of middlewares that should apply to all routes in this group.

Readonly prefix

prefix: string

Static Private currentGroupNesting

currentGroupNesting: RouteGroup[] = []

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

Static Protected namedGroups

namedGroups: {} = {}

Mapping of group names to group registration functions.

Type declaration

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

Accessors

Private appClassApplication

Methods

Protected app

Protected container

getBoundMethod

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

    Parameters

    • methodName: string

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

    function

      • (...args: any[]): any
      • Parameters

        • Rest ...args: any[]

        Returns any

getGroupMiddlewareDefinitions

Protected make

  • make<T>(target: any, ...parameters: any[]): T

post

pre

Static getCurrentGroupHierarchy

Static include

  • include(name: string): void
  • 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

Static named

  • named(name: string, define: () => void): 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

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.