Class BaseRouterHandler<T>Abstract

Checks if a given method and path are satisfied and allows its handler to be executed if so.

Implementations of this class should call canHandleInput in their canHandle call with the correct parameters.

canHandleInput expects a ResourceIdentifier to indicate it expects the target to have been validated already.

Type Parameters

Hierarchy (view full)

Constructors

Properties

allMethods: boolean
allowedMethods: string[]
allowedPathNamesRegEx: RegExp[]
baseUrlLength: number
handler: T

Methods

  • Checks whether the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.

    Parameters

    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.