Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Route

Hierarchy

  • Route

Implemented by

Index

Properties

Methods

Properties

Optional enabled

enabled: boolean

Whether the route is enabled. Set to false to disable.

Optional handle

handle: (evt: RouterEvent) => Promise<RouterResponse | null | void> | RouterResponse | null | void

Handle and respond to the ProxyEvent.

Return a RouterResponse object or a Promise that resoles to a RouterResponse object to handle the event.

Return null or resolve the Promise with null to not respond and let other Routes handle it. postProcess() will still be called in that case.

Type declaration

Optional postProcess

postProcess: (evt: RouterEvent, resp: RouterResponse, handlingRoutes: Route[]) => Promise<RouterResponse | null | void> | RouterResponse | null | void

Post-process the response before it is sent.

Return a RouterResponse object or a Promise that resolves to a RouterResponse object to change the response. Modifying the object in place will also change the response.

Type declaration

Methods

matches

  • Test whether this Route matches the ProxyEvent. If true handle() and postProcess() will be called (if defined).

    Parameters

    Returns boolean

Generated using TypeDoc