We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposed changes:
npm uninstall @types/aws-serverless-express npm uninstall aws-serverless-express npm i --save @vendia/serverless-express
import { ValidationPipe } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { ExpressAdapter } from '@nestjs/platform-express'; import serverlessExpress from '@vendia/serverless-express'; import { APIGatewayProxyHandler, Handler } from 'aws-lambda'; import express from 'express'; import { AppModule } from './app.module'; let cachedServer: Handler; const bootstrapServer = async (): Promise<Handler> => { const expressApp = express(); const app = await NestFactory.create(AppModule, new ExpressAdapter(expressApp)); app.useGlobalPipes(new ValidationPipe({ forbidUnknownValues: true })); app.enableCors(); await app.init(); return serverlessExpress({ app: expressApp }); }; export const handler: APIGatewayProxyHandler = async (event, context, callback) => { if (!cachedServer) { cachedServer = await bootstrapServer(); } return cachedServer(event, context, callback); };
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
proposed changes:
The text was updated successfully, but these errors were encountered: