Skip to content
Nathanaël Cherrier (CI) edited this page Aug 27, 2019 · 4 revisions

Route (interface)

interface IRoute {
  path: string,
  action: string|IAction,
  methodes: HttpMethod[]
}

Description

Represents a route: a single endpoint. A Controller contains a list of routes.

Exemple

export class AController extends Controller {
  get routes(): Route[] {
    return [{ path: 'home', action: 'homeAction', methods: [HttpMethod.GET] }]
  }
}

Properties

  • path: The path of the endpoint
  • actions: The name or an instance of the linked route.
  • methods: List of allowed methods.
Clone this wiki locally