Steps to deploy the backend api in heroku
-
create a Heroku app
heroku create app-name-here
-
Push the code to heroku git
git push heroku master
-
Run the server
heroku ps:scale web=1
-
Add the following variables in the
Config Vars
section under theSettings
tab in your heroku app.IS_PROD=true, JWT_SECRET=your secret here
-
To chceck whether it is deployed fine run
heroku open
This will giveCannot GET /
in the browser. Since this is not configured route, so thats fine. -
To connect the hosted api to the react project run
yarn start:web
(Update your api domain in the script)