I m working on building a NestJS API application using a monorepo approach to keep all my endpoints organized in one codebase. However, I m facing a challenge when it comes to deploying this application to multiple AWS Lambdas, each representing a different module (like Auth, Users, Posts, etc.), and then mapping them to a unified API Gateway.
In my previous attempts, I ve created separate NestJS projects for each module, which resulted in a maintenance nightmare due to shared code complexities. Now, I m exploring the option of maintaining a single codebase for all modules. My goal is to deploy each module as an individual AWS Lambda function, while still keeping the codebase manageable.
So, here s my main question: Can I achieve this setup using the Serverless Framework? I want to have a single codebase for all the modules and deploy them to separate AWS Lambdas. Additionally, I m aiming to integrate these Lambdas under a single API Gateway to provide a unified API access point.
Any insights, advice, or examples on how to structure my Serverless Framework configuration, how to manage the shared codebase efficiently, and how to set up the API Gateway to work with these multiple Lambdas would be greatly appreciated. Thank you in advance for your help!