Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Route

Responsible to hold information of a route.

Hierarchy

  • Route

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Route(path: string, method: string): Route
  • Instanciates a new route.

    Parameters

    • path: string

      route's path

    • method: string

      route's http method

    Returns Route

Properties

Private _method

_method: string

Route's http method.

Private _params

_params: Array<string>

Route's path parameters

Private _path

_path: string

Route's path.

Private _queue

_queue: Array<RequestDelegate>

Route's execution queue.

matchedParams

matchedParams: any

Route's parameters resolved at doesMatch

Accessors

method

  • get method(): string

path

  • get path(): string
  • set path(p: string): void

queue

Methods

handle

  • Executes router execution queue.

    Parameters

    Returns Promise<void>

match

  • match(path: string, method: string): boolean
  • Checks if requested path and method match route's details.

    Parameters

    • path: string

      requested path

    • method: string

      requested http method

    Returns boolean

use

  • Adds a function to the route execution queue.

    Parameters

    Returns void

Generated using TypeDoc