Setup for NestJS on Lambda
Install Supergood as Middleware for your NestJS application.
Install the Supergood library
Initialize the Supergood library as middleware
Create new middleware as supergood.middleware.ts
or add to existing middleware. Setting useRemoteConfig: true
will introduce an additional async call on Lambda start, and will allow certain Supergood features to be available such as fine-grained redaction and on-premise schema validation.
This middleware flushes the Supergood cache after your response is returned to the client, so it will not slow down your lambda function.
Add the Supergood middleware
Inside of app.module.ts
Add the Supergood middleware to any route containing API calls you wish to track. This example applies Supergood middleware to all routes.
Example Repository
Here is an example repository of Supergood running on a NestJS application deployed on Lambda.
https://github.com/supergoodsystems/nestjs-aws-lambda-example
Last updated