Skip to content

alexcasalboni/serverless-multi-region-client-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless Multi-Region Client Demo

Sample React application to demonstrate multi-region applications.

How to setup

  1. 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
  1. 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

  1. Install local dependencies:
npm install
  1. Run the local server:
npm start

How to deploy to AWS

  1. Build the React app:
npm run build
  1. Configure your AWS CLI (doc here, installation guide here):
aws configure
  1. Configure the bucket name as environment variable:
export S3_BUCKET_NAME=YOUR_BUCKET_NAME
  1. 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

Serverless Backend

You can find the Serverless backend at alexdebrie/serverless-multi-region.

About

Sample frontend for a multi-region serverless application on AWS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published