In this section, we will deploy our React frontend to Heroku. The easiest way to deploy the React app to Heroku is to use the Heroku Buildpack for create-react-app (https://github.com/mars/create-react-app-buildpack). For deployment, we have to install the Heroku CLI, which is the command-line tool for Heroku. You can download the installation package from https://devcenter.heroku.com/articles/heroku-cli. Once installation is complete, you can use the Heroku CLI from PowerShell or the Terminal you're using. The following steps describe the deployment process:
- Open your frontend project with VS Code and open the constant.js file in the editor. Change the SERVER_URL constant to match our backend's URL, and save the changes:
export const SERVER_URL = 'https://carbackend.herokuapp.com/'
- Create a local Git repository for your project and...