Options
All
  • Public
  • Public/Protected
  • All
Menu

The Router is responsible for routing Lambda events to controllers and executing the middleware pipeline.

Hierarchy

  • Router

Index

Constructors

Properties

controllers: any[] = []
middleware: MiddlewarePipeline<any, any> = []

Methods

  • findDestination(event: unknown): undefined | Destination
  • getHandler<TEvent, TResult>(): Handler<TEvent, TResult>
  • Get a Lambda event handler.

    • This is the function that should be provided to the Lambda runtime.

    Type Parameters

    • TEvent = unknown

    • TResult = unknown

    Returns Handler<TEvent, TResult>

  • invoke(event: unknown, context: Context, pipeline: MiddlewarePipeline<unknown, unknown>, handler: Handler<unknown, unknown>, destination: undefined | Destination): Promise<unknown>
  • Parameters

    • event: unknown
    • context: Context
    • pipeline: MiddlewarePipeline<unknown, unknown>
    • handler: Handler<unknown, unknown>
    • destination: undefined | Destination

    Returns Promise<unknown>

  • logDebugMessage(debugMessage: string): void
  • passToController(event: unknown, context: Context, destination: undefined | Destination): Promise<unknown>
  • Parameters

    • event: unknown
    • context: Context
    • destination: undefined | Destination

    Returns Promise<unknown>

  • registerController(controller: any): Router
  • registerControllers(controllers: any[]): Router
  • registerMiddleware(...middleware: MiddlewarePipeline<any, any>): Router
  • route(event: APIGatewayProxyEvent, context: Context): Promise<APIGatewayProxyResult>
  • route(event: ScheduledEvent<any>, context: Context): Promise<void>
  • route(event: SQSEvent, context: Context): Promise<void>
  • route(event: DynamoDBStreamEvent, context: Context): Promise<void>
  • route(event: KinesisStreamEvent, context: Context): Promise<void>
  • route<TDetailType, TDetail>(event: EventBridgeEvent<TDetailType, TDetail>, context: Context): Promise<void>
  • route(event: S3Event, context: Context): Promise<void>
  • route(event: SNSEvent, context: Context): Promise<void>
  • Route an incoming API Gateway event to a controller.

    Parameters

    • event: APIGatewayProxyEvent

      The API Gateway event.

    • context: Context

      The Lambda context.

    Returns Promise<APIGatewayProxyResult>

  • Route a scheduled event to a controller.

    Parameters

    • event: ScheduledEvent<any>

      The scheduled event.

    • context: Context

      The Lambda context.

    Returns Promise<void>

  • Route an incoming SQS event to a controller.

    Parameters

    • event: SQSEvent

      The SQS event.

    • context: Context

      The Lambda context.

    Returns Promise<void>

  • Route an incoming Dynamo DB stream event to a controller.

    Parameters

    • event: DynamoDBStreamEvent

      The Dynamo DB stream event.

    • context: Context

      The Lambda context.

    Returns Promise<void>

  • Route an incoming Kinesis stream event to a controller.

    Parameters

    • event: KinesisStreamEvent

      The Kinesis stream event.

    • context: Context

      The Lambda context.

    Returns Promise<void>

  • Route an incoming EventBridge event to a controller.

    Type Parameters

    • TDetailType extends string

    • TDetail

    Parameters

    • event: EventBridgeEvent<TDetailType, TDetail>

      The EventBridge event.

    • context: Context

      The Lambda context.

    Returns Promise<void>

  • Route an incoming S3 event to a controller.

    Parameters

    • event: S3Event

      The S3 event.

    • context: Context

      The Lambda context.

    Returns Promise<void>

  • Route an incoming SNS event to a controller.

    Parameters

    • event: SNSEvent

      The SNS event.

    • context: Context

      The Lambda context.

    Returns Promise<void>

Generated using TypeDoc