Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Route

Hierarchy

  • Route

Index

Constructors

constructor

  • Parameters

    Returns Route

Properties

Private _path

_path: string

Optional children

children: RouteCollection

Optional handler

handler: RouteHandler

keys

keys: Key[] = []

method

method: HttpMethod = HttpMethod.ALL

Optional parent

parent: Route

Accessors

path

  • get path(): string
  • set path(value: string): void
  • Returns string

  • Parameters

    • value: string

    Returns void

regexp

  • get regexp(): RegExp
  • Returns RegExp

Methods

add

  • 添加子路由

    Parameters

    Returns this

getPathParam

  • 路径参数

    Type parameters

    • T: object

    Parameters

    • url: string

    Returns HttpPathParam<T>

match

  • match(path: string): boolean
  • 匹配路由

    Parameters

    • path: string

    Returns boolean

Static create

  • 创建Route

    Parameters

    Returns Route

Static createChildRoute

Generated using TypeDoc