serverless-todo
serverless-todo copied to clipboard
React TodoMVC with a Serverless backend
serverless-todo
React TodoMVC with a Serverless backend.
It provides a demo integration of React + API Gateway + AWS Lambda + Node.js + Amazon DynamoDB
Deploy with CloudFormation
Prerequisites: Node.js, yarn, and AWS CLI installed
- Create an AWS Account and IAM User with the
AdministratorAccess
AWS Managed Policy - Run
aws configure
to put store that user's credentials in~/.aws/credentials
- Create an S3 bucket for storing the Lambda code and store its name in a shell variable with:
-
export CODE_BUCKET=<bucket name>
-
- Npm install:
-
yarn install
-
- Build:
-
yarn build
-
- Upload package to S3, transform the CloudFormation template:
-
yarn package
-
- Deploy to CloudFormation:
-
yarn deploy
-
Deploy from the AWS Serverless Application Repository
- Hit "Deploy" from the application page
Use
- In the API Gateway Console
- Navigate to APIs / aws-serverless-repository-serverless-todo / Settings
- Hit Add Binary Media Type
- Enter
*/*
in the box - Hit Save Changes
- Navigate to APIs / aws-serverless-repository-serverless-todo / Resources
- Click the Actions dropdown
- Click Deploy API
- Deployment stage: prod
- Deployment description: Adding binary support
- Hit Deploy
- Navigate to APIs / aws-serverless-repository-serverless-todo / Dashboard
- Find the Invocation url, something like https://xxxxxxxxx.execute-api.region.amazonaws.com/Prod/
- (You can also set up custom domain name)
- Open the invocation url in your browserz
Links
- serverless-todo on Github
- serverless-todo on the AWS Serverless Application Repository
License
© 2017-2024 Evan Chiu. This project is available under the terms of the MIT license.