Preparation
Before we get to the main content of this workshop, we need to reset the web application.
- Download the below source code
fcj-book-store-sam-ws5.zip
(8258 ko)
-
Run the below commands
sam build
sam deploy --guided
-
Enter the following content:
- Stack Name []:
fcj-book-shop
- AWS Region []:
us-east-1
- Confirm changes before deploy [Y/n]: y
- Allow SAM CLI IAM role creation [Y/n]: y
- Disable rollback [y/N]: n
- BooksList may not have authorization defined, Is this okay? [y/N]: y
- BookCreate may not have authorization defined, Is this okay? [y/N]: y
- BookDelete may not have authorization defined, Is this okay? [y/N]: y
- Save arguments to configuration file [Y/n]: y
-
Open AWS APIs Gateway console. Then click API Gateway REST API to Lambda
-
Click Stage on the left menu
- Click staging
- Record the InvokeURL
-
Run the below command to download the source code of FCJ-Serverless-Workshop to your device
git clone https://github.com/AWS-First-Cloud-Journey/FCJ-Serverless-Workshop.git
- Open config.js file, replace value of APP_API_URL with InvokeURL
-
Run the below commands to build project
cd FCJ-Serverless-Workshop
yarn build
-
We have finished building the front-end. Next, run the below command to upload build folder to S3 bucket
aws s3 cp build s3://fcj-book-shop --recursive
So we have rebuilt the web application.