This project is a Boilerplate for building RESTful API with Node.js, Express and DynamoDB. Deployed in a server-less way to AWS Lambda and AWS API Gateway using Claudia.js and dev local using gulp
Simple REST API deplyed in AWS Lambda persisting data into DynamoDB and retrieving data back.
Express is a minimal and flexible Node.js micro web application framework. Express provides HTTP utility methods and middleware to create quick API.
API Gateway and Lambda together provides a secure, easy and elegant way to create and deploy serverless Web applications without the overhead of managing servers.
Amazon DynamoDB is a fully managed and hosted AWS NoSQL database service.
Claudia.js is an open source Node.js deployment tool that helps automated deployment of Node.js app in a server-less way to AWS Lambda and AWS API Gateway.
- Express
- Claudia.js
- Migrating an Express Application to Amazon API Gateway and AWS Lambda
- aws-serverless-express
- DynamoDB and Node.js
The easiest way to get started is to clone the repository:
git clone --depth=1 [email protected]:ravishan16/ExpressApi.git myproject
cd myproject
npm install
To Install Gulp commandline run
sudo npm install -g gulp
Execute gulp. This invokes app.local.js under scripts. gulp-nodemon Automatically restart Node.js server on code changes.
gulp
Deploying a NodeJS app to AWS can be done is so many different ways. One of the easiest way is to use ClaudiaJS
and deploy the app in a server-less way to AWS Lambda and AWS API Gateway.
- Configure awscli
- Create table in DynamoDB
- Deploy App to AWS
- Push changes to AWS
pip install awscli
aws configure
AWS Access Key ID [None]: XXXX
AWS Secret Access Key [None]: XXXX
Default region name [None]: us-east-1
Default output format [None]: json
create-db is defined as task in package.json script. This executes scripts/createDB.js
npm run create-db
Use deploy for first time deployment. deploy is defined as npm run task in package.json script
claudia create --policies policies --handler lambda.handler --deploy-proxy-api --region us-east-1
npm run deploy
Use update for update to initial deployment. update is defined as npm run task in package.json script
claudia update
npm run update
-- Ravishankar Sivsasubramaniam