This project was created as a POC when moving from NodeJS(Express) - MongoDB(Mongoose) to NodeJS(Lamda- API Gateway) - DyanamodDB(Dyanmoose).
One of the most important checkpoints in evaluating a new technology is how easy is it to test and debug locally. With serverless, testing and debugging the APIs is never straight forward as there is no Local server where the APIs can be hosted.
After a bit a reasearch I found the combination of the serverless-offline plugin with Visual Studio Code to be the best solution for testing and debugging the application.
The application connects to a Local Dynamo DB connection.
- Pull the code.
- Open the console and navigate to the folder where the code is present.
- Resolve the dependencies - npm install.
- Start DyananoDB on your local machine.
- Open the project in Visual Studio Code.
- Select the Start Severless run configuration, in the Debug section.
- Start and application, and now you are good to go.
- :-)