Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

udacity/reactnd-contacts-complete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisite

A Backend API should be up and running. Note the serving URL.

Deploy the Frontend App

  1. Have your Frontend UI code point to the Backend API URL.
cd reactnd-contacts-complete

Open the src/utils/ContactsAPI.js file, and update the const api URL. See an exmaple below:

// Before
const api = process.env.REACT_APP_CONTACTS_API_URL || 'http://localhost:4000'
// After
const api = process.env.REACT_APP_CONTACTS_API_URL || 'http://reactnd-contacts-server-dev.us-east-1.elasticbeanstalk.com'

Use http (not https) and do not add any trailing slash (/) at the end of URL.

  1. Generate the artifacts to deploy:
rm -rf node_modules
rm -f package-lock.json
npm install
# Generate the new artifacts
npm run build

The build script will generate a /build/ directory in the current directory.

  1. Optional - Deploy the UI code to S3 using the AWS CLI.
# List the buckets
aws s3 ls
# Assuming the bucket name is: myawsbucket-751397240855

Synchronize the content of the build folder into the S3 bucket.

# Change the bucket name as applicable to you
aws s3 cp --recursive --acl public-read ./build s3://myawsbucket-751397240855/

Navigate to the URL of your S3 bucket to ensure the deployments worked and that the website is healthy.

Archival Note

This repository is deprecated; therefore, we are going to archive it. However, learners will be able to fork it to their personal Github account but cannot submit PRs to this repository. If you have any issues or suggestions to make, feel free to: