Sample React application to demonstrate multi-region applications.
- 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
- Install local dependencies:
npm install
- Run the local server:
npm start
- 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:
# using the default AWS profile
npm run deploy
# using your own AWS profile
npm run deploy -- --profile YOUR_PROFILE
# with dryrun (unless YOLO)
npm run deploy -- --dryrun
You can find the Serverless backend at alexdebrie/serverless-multi-region.