Saturday 4 August 2018

deploy react on surge

Install Surge:
npm install -g surge

Run the Create React App build:
cd your-react-project

npm run build
Switch into the build directory:
cd build

Run Surge, and follow the prompts. All it needs is an email and a password, and you can optionally specify a different domain name.
surge

enter ->change the domain name to projectName.surge.sh -> enter

Go to the URL it prints out. For instance, http://lively-payment.surge.sh/.

reference:
https://daveceddia.com/deploy-create-react-app-surge/
https://medium.freecodecamp.org/surge-vs-github-pages-deploying-a-create-react-app-project-c0ecbf317089
https://surge.sh/help/adding-a-custom-domain

No comments:

Post a Comment