Skip to content

Commit 267ade9

Browse files
authored
Minor extensions in README; add simple Makefile (#10)
* minor docs extensions; add Makefile * update docs for CORS configuration
1 parent 39e0c2d commit 267ade9

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
usage: ## Show usage for this Makefile
3+
@cat Makefile | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
4+
5+
deploy: ## Deploy the application to LocalStack
6+
bin/deploy.sh
7+
8+
web: ## Open the Web app in the browser (after the app is deployed)
9+
DOMAIN_NAME=$$(awslocal cloudfront list-distributions | jq -r '.DistributionList.Items[0].DomainName'); \
10+
echo "CloudFront URL: https://$$DOMAIN_NAME"; \
11+
open "https://$$DOMAIN_NAME"
12+
13+
save-state: ## Save the application state to a local file
14+
localstack state export app-state.zip
15+
16+
load-state: ## Load the application state from a local file
17+
localstack state import app-state.zip
18+
19+
clean: ## Clean up any temporary files
20+
rm *.zip
21+
22+
.PHONY: usage deploy web save-state load-state clean

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Serverless Quiz App
22

3-
This project showcases a fully serverless quiz application designed to demonstrate LocalStack's capabilities in supporting local cloud development, debugging, and testing throughout the entire software development lifecycle (SDLC). The application enables users to create quizzes, participate by submitting answers, and view leaderboards for top scores. It leverages various LocalStack features to highlight the platform's capabilities, including:
3+
This project showcases a fully serverless quiz application designed to demonstrate LocalStack's capabilities in supporting local cloud development, debugging, and testing throughout the entire software development lifecycle (SDLC).
4+
The application enables users to create quizzes, participate by submitting answers, and view leaderboards for top scores.
5+
It leverages various LocalStack features to highlight the platform's capabilities, including:
46

57
- Emulating cloud environments locally with **Core Cloud Emulator**.
68
- Utilizing **Resource Browsers** for inspecting local resources.
@@ -29,12 +31,16 @@ The following resources are being deployed:
2931
- **CloudFront**: Delivers frontend assets from S3 globally for fast user access.
3032
- **S3**: Hosts static frontend assets in `webapp` bucket for CloudFront distribution.
3133

34+
## Prerequisites
35+
36+
Some of the features in this sample app require a LocalStack Pro license - make sure your Auth Token is configured in your terminal session.
37+
3238
## Start LocalStack
3339

3440
Start your LocalStack container with the following configuration:
3541

3642
```bash
37-
EXTRA_CORS_ALLOWED_ORIGINS=* DISABLE_CUSTOM_CORS_APIGATEWAY=1 localstack start
43+
EXTRA_CORS_ALLOWED_ORIGINS='*' DISABLE_CUSTOM_CORS_APIGATEWAY=1 DISABLE_CUSTOM_CORS_S3=1 localstack start
3844
```
3945

4046
If you run into specific CORS issues, disable it using a [browser extension](https://webextension.org/listing/access-control.html).

bin/deploy.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)