serverless-aws-lambda
Version:
AWS Application Load Balancer and API Gateway - Lambda dev tool for Serverless. Allows Express synthax in handlers. Supports packaging, local invoking and offline ALB, APG, S3, SNS, SQS, DynamoDB Stream server mocking.
45 lines (44 loc) • 1.23 kB
TypeScript
import { CommonEventGenerator } from "./common";
import { IncomingMessage, ServerResponse } from "http";
import type { LambdaEndpoint } from "../../../lib/parseEvents/endpoints";
interface AlbPayload {
requestContext: {
elb: {
targetGroupArn: string;
};
};
multiValueHeaders?: {
[key: string]: string[];
};
multiValueQueryStringParameters?: {
[key: string]: string[];
};
queryStringParameters?: {
[key: string]: string;
};
headers?: {
[key: string]: any;
};
httpMethod: string;
path: string;
isBase64Encoded: boolean;
body?: string;
}
export declare class AlbRequestHandler extends CommonEventGenerator {
#private;
res: ServerResponse;
payload: AlbPayload;
mockEvent: LambdaEndpoint;
constructor({ res, req, body, mockEvent, multiValueHeaders, isBase64Encoded, lambdaName, }: {
res: ServerResponse;
req: IncomingMessage;
body: any;
mockEvent: LambdaEndpoint;
multiValueHeaders: any;
isBase64Encoded: boolean;
lambdaName: string;
});
returnError: () => true | ServerResponse;
sendResponse: (output?: any) => void;
}
export {};