UNPKG

@mcma/aws-api-gateway

Version:

Node module with code for using AWS's API Gateway as an entry point to an MCMA API handler.

19 lines (18 loc) 969 B
import { ConfigVariables, LoggerProvider } from "@mcma/core"; import { McmaApiRouteCollection, McmaApiMiddleware } from "@mcma/api"; import { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyResultV2, Context } from "aws-lambda"; export interface ApiGatewayApiControllerConfig { routes: McmaApiRouteCollection; loggerProvider?: LoggerProvider; configVariables?: ConfigVariables; middleware?: McmaApiMiddleware[]; includeStageInPath?: boolean; } export declare class ApiGatewayApiController { private apiController; private config; constructor(config: ApiGatewayApiControllerConfig); constructor(routes: McmaApiRouteCollection, loggerProvider?: LoggerProvider, configVariables?: ConfigVariables); handleRequest(event: APIGatewayProxyEventV2, context: Context): Promise<APIGatewayProxyResultV2>; handleRequest(event: APIGatewayProxyEvent, context: Context): Promise<APIGatewayProxyResult>; }