Serverless Multi-Region Client Demo
Sample React application to demonstrate multi-region applications.
How to setup
- Configure the Google Maps API Key as environment variable (you can create one here):
export REACT_APP_GOOGLE_MAP_API_KEY=YOUR_GOOGLE_MAP_API_KEY
- Setup your regional endpoints in src/regions.yml. For example:
us-west-2:
name: Oregon (US)
lat: 43.791332
long: -120.728691
endpoint: YOUR_REGIONAL_API_GATEWAY_ENDPOINT
How to run locally
- Install local dependencies:
npm install
- Run the local server:
npm start
How to deploy to AWS
- Build the React app:
npm run build
- Configure your AWS CLI (doc here, installation guide here):
aws configure
- Configure the bucket name as environment variable:
export S3_BUCKET_NAME=YOUR_BUCKET_NAME
- Deploy the static assets to S3:
npm run deploy
npm run deploy -- --profile YOUR_PROFILE
npm run deploy -- --dryrun
Serverless Backend
You can find the Serverless backend at alexdebrie/serverless-multi-region.