This is a starter template for NodeJS + Typescript + Mongodb application. Additionally it has AWS lambda setup.
- mkdir
<yourProjectName>
&& cd<yourProjectName>
git clone --depth 1 https://github.com/TheSubbu/Node-typescript-starter.git .
- Run
npm install
to install all the dependencies. - Run
npm start
to start the server.
Here we using claudiajs to setup the lamdba function
- Install and configure claudiajs. Reference
- Build the project by running
npm run build-ts
. - Rename the name in package.json to give a name to your lambda function.
- Run
npm run prepateToDeployLambda
to prepare the project to deploy to lambda. - Run
npm run create-lambda-func
to create the lambda function. - Run
npm run update-lambda
atleast once after creating lambda function.(Basically it will update the lambda function).
That's it. Your first serverless function is up now.
And to update the lambda function repeat the step 5.
Note: Use lambda.env.json file for production environment variables
Easy right 😊. Happy Coding 💻