Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ApiViewBase

A view with method-based routing.

Subclass ApiViewBase to define your own class-based API endpoints.

Define sub-paths with SubRoute.

Hierarchy

Index

Constructors

constructor

Methods

dispatch

  • Handle a request by dispatching to appropriate handler.

    Parameters

    • event: ApiEvent

      API Gateway Proxy v2 Lambda event

    • context: Context

      Lambda invocation context

    Returns ApiResponse

findHandler

  • Look up appropriate method to handle an incoming request for this view.

    Parameters

    • event: ApiEvent

      API Gateway Proxy v2 Lambda event

    Returns undefined | ApiHandler

    handler method to process request

getMetadata

Protected handleDispatchError

  • handleDispatchError(ex: unknown): APIGatewayProxyResultV2<never>
  • Transform error caught during dispatch to an HTTP response.

    Parameters

    • ex: unknown

    Returns APIGatewayProxyResultV2<never>

Protected matchSubRoute

Protected matchesRouteKey

  • matchesRouteKey(routeKey: string, method: HttpMethod, path: string, methods?: HttpMethod[]): boolean
  • Parameters

    Returns boolean

Generated using TypeDoc