Deploying a React App to Surge.sh
· One min read
To deploy a React app to Surge.sh, follow the instructions below:
- Create a new file named
CNAME
in the public folder and enter the name of your surge domain in it. - In the terminal in the root directory of your project, run the following commands:
npm run build
cd build
- Rename
index.html
to200.html
in the build folder, for client side routing. - Run
surge
in the terminal to deploy your app to surge.sh