Simple Serverless example project to show Lambda/API Gateway/DynamoDB in action.
git clone git@github.com:aws-user-group-cuneo/serverless-101.git
npm install
aws configure
Additional you can create a specific profile for this project:
aws configure --profile awsug-serverless-101
You need to change the frontend bucket name to not collide with other users. Do this change into serverless.yml
file:
custom:
frontend:
bucket: ${self:service}-${self:provider.stage}-<my name or something random> #change this with a different name
dir: './frontend'
cacheControl: '0'
deploy: sync
npm run deploy
Change the API endpoint inside frontend/index.html
inside script tag;
var ENDPOINT = 'https://xxxxxxx.execute-api.eu-west-1.amazonaws.com/test'; // Change this with your endpoint
npm run deploy:frontend
If you correctly complete all steps you'll see the static website on: http://your-bucket-name.s3-website-eu-west-1.amazonaws.com