convert-lambda-to-express
Version:
Wrapper to run lambda on express. Works great for running lambdas as an express server during development but is production ready. Developed to work in conjunction with matthewkeil/full-stack-pattern cdk construct.
15 lines (14 loc) • 836 B
TypeScript
import { APIGatewayProxyWithCognitoAuthorizerHandler } from 'aws-lambda';
import { Logger } from 'winston';
import { Handler } from 'express';
import { Credentials } from 'aws-sdk';
import { ContextOptions } from './Context';
import { EventOptions } from './Event';
import { ConvertResponseOptions } from './convertResponse';
export interface WrapperOptions extends Omit<ContextOptions, 'startTime' | 'credentials'>, Pick<EventOptions, 'isBase64EncodedReq' | 'resourcePath' | 'stage' | 'stageVariables'>, ConvertResponseOptions {
credentialsFilename?: string;
profile?: string;
logger?: Logger;
}
export declare function getCredentials(filename?: string, profile?: string): Credentials | undefined;
export declare function wrapLambda(handler: APIGatewayProxyWithCognitoAuthorizerHandler, options?: WrapperOptions): Handler;