Skip to main content

Class: Router

Hierarchy

  • EventEmitter

    Router

Constructors

constructor

new Router(app)

Parameters

NameType
appApp

Overrides

EventEmitter.constructor

Defined in

packages/disploy/src/router/Router.ts:33

Properties

app

Private app: App

Defined in

packages/disploy/src/router/Router.ts:30


ready

Private ready: boolean = false

Defined in

packages/disploy/src/router/Router.ts:31


routes

Private routes: BaseRoute[] = []

Defined in

packages/disploy/src/router/Router.ts:28


verifier

Private Optional verifier: null | Verify = null

Defined in

packages/disploy/src/router/Router.ts:29


prefixed

Static prefixed: string | boolean

Inherited from

EventEmitter.prefixed

Defined in

node_modules/eventemitter3/index.d.ts:9

Methods

addListener

addListener<T>(event, fn, context?): Router

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fn(...args: any[]) => void
context?any

Returns

Router

Inherited from

EventEmitter.addListener

Defined in

node_modules/eventemitter3/index.d.ts:45


addRoute

addRoute(route): void

Parameters

NameType
routeBaseRoute

Returns

void

Defined in

packages/disploy/src/router/Router.ts:51


emit

emit<T>(event, ...args): boolean

Calls each of the listeners registered for a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
...argsany[]

Returns

boolean

Inherited from

EventEmitter.emit

Defined in

node_modules/eventemitter3/index.d.ts:32


entry

entry(req): Promise<TResponse>

Parameters

NameType
reqTRequest

Returns

Promise<TResponse>

Defined in

packages/disploy/src/router/Router.ts:71


eventNames

eventNames(): (string | symbol)[]

Return an array listing the events for which the emitter has registered listeners.

Returns

(string | symbol)[]

Inherited from

EventEmitter.eventNames

Defined in

node_modules/eventemitter3/index.d.ts:15


handle

Private handle(req, res): Promise<TResponse>

Parameters

NameType
reqTRequest
resTResponse

Returns

Promise<TResponse>

Defined in

packages/disploy/src/router/Router.ts:125


listenerCount

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

NameType
eventstring | symbol

Returns

number

Inherited from

EventEmitter.listenerCount

Defined in

node_modules/eventemitter3/index.d.ts:27


listeners

listeners<T>(event): (...args: any[]) => void[]

Return the listeners registered for a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT

Returns

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

Inherited from

EventEmitter.listeners

Defined in

node_modules/eventemitter3/index.d.ts:20


off

off<T>(event, fn?, context?, once?): Router

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fn?(...args: any[]) => void
context?any
once?boolean

Returns

Router

Inherited from

EventEmitter.off

Defined in

node_modules/eventemitter3/index.d.ts:69


on

on<T>(event, fn, context?): Router

Add a listener for a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fn(...args: any[]) => void
context?any

Returns

Router

Inherited from

EventEmitter.on

Defined in

node_modules/eventemitter3/index.d.ts:40


once

once<T>(event, fn, context?): Router

Add a one-time listener for a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fn(...args: any[]) => void
context?any

Returns

Router

Inherited from

EventEmitter.once

Defined in

node_modules/eventemitter3/index.d.ts:54


removeAllListeners

removeAllListeners(event?): Router

Remove all listeners, or those of the specified event.

Parameters

NameType
event?string | symbol

Returns

Router

Inherited from

EventEmitter.removeAllListeners

Defined in

node_modules/eventemitter3/index.d.ts:79


removeListener

removeListener<T>(event, fn?, context?, once?): Router

Remove the listeners of a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fn?(...args: any[]) => void
context?any
once?boolean

Returns

Router

Inherited from

EventEmitter.removeListener

Defined in

node_modules/eventemitter3/index.d.ts:63


routeResolver

Private routeResolver(payload): undefined | BaseRoute

Parameters

NameType
payloadAPIInteraction

Returns

undefined | BaseRoute

Defined in

packages/disploy/src/router/Router.ts:101


start

start(): void

Returns

void

Defined in

packages/disploy/src/router/Router.ts:38


verifyRequest

Private verifyRequest(req): Promise<boolean>

Parameters

NameType
reqTRequest

Returns

Promise<boolean>

Defined in

packages/disploy/src/router/Router.ts:55