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
CNAMEin 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.htmlto200.htmlin the build folder, for client side routing. - Run
surgein the terminal to deploy your app to surge.sh
