How to Deploy a React App to Heroku

Publication: 1 of December, 2020
Hello Guys, today, I am going to show you how you can deploy a React App to Heroku, as I have found many blogs on the Internett that do not provided accurate information about it.
We are going to focus if you already have a react app created, so go ahead and opend your terminal and CD to where you have your react project, first where you are in there type the command below so you can login to your heroku account ,and enter your credentials.

heroku login

After you enter your credentials, go ahead and create an app with the command below together with the mars buildpack.

heroku create (Your app name) --buildpack mars/create-react-app

After you created your app, you can now start by addding the files and making the commit to deploy it, with the commands below.

//first command
git add .

//second command
git commit -m "Commit to deploy to Heroku Server" 

After we have commited our changes we can go ahead and deploy it yo live, with the command below.

git push heroku master

Now you can open your app and Wuala!, This is the magic of the masr buildpack you can find the github repository here Heroku Buildpack for create-react-app. I hoped this was useful for you and let's continue the journey of coding.

Copyright Luis Gonzalez 2021