Skip to content

Deploying Backend Method #2

tks18 edited this page Dec 3, 2020 · 15 revisions

Deploying Backend - Method 1: Deploy the Backend Using Git and Heroku CLI Manually Deploying the Backend Server.

Install the Latest Nodejs Version:

  • Click Here to Download the Latest Nodejs Version.

Install Latest Git Version:

Configure Git:

  • Before Using Git, You have to Configure the Git username and email from which it should Commit the Changes, Which can be Done by:

    • Set the Username (Replace Yours with the Example)
    > git config --global user.name "FIRST_NAME LAST_NAME"
    • Set the Email (Replace Yours with the Example)
    > git config --global user.email "MY_NAME@example.com"

Install Heroku CLI:

  • Install the Latest Heroku CLI Version by Clicking Below:

    > brew tap heroku/brew && brew install heroku
    • For Linux:
    > sudo snap install --classic heroku

    (or)

    > npm install -g heroku

Get the Latest Package of Backend Server:

  • You have to Download the Latest Backend Server Zip from my Repo. You can find the Latest Releases of the Backend Here. Backend Releases will be Tagged as "backend-V.V.V"

  • Current Latest Backend Version - backend-v2.2.4.

  • Download the Zip from the Assets.

Extract the Zip and Initialize the Repo with git:

  • After Downloading the Zip, Extract the Zip to a Location. Open Terminal/cmd/powershell in that folder where You have Extracted.

  • Type the Following Commands:

    • Initialize the Folder with Git:
    > git init
    • Add the Files for Staging Area:
    > git add .
    • Commit those Changes:
    > git commit -m "Upload Backend for Deployment"

Login to Heroku CLI:

  • Every Commands below Should also be in the Same Folder.
  • After the Above Step, login in to Heroku:
> heroku login

Create Heroku App:

  • Create a Heroku app in the Browser Logging into their Website.
  • Enter a unique app name when Prompted. This will come before herokuapp.com, Example: https://sample.herokuapp.com

Deploy the Backend:

  • Go back to same Folder in which git was Initialized and open cmd/terminal/powershell.

  • Enter the Following Commands:

    • Set the Git for Your Heroku App (Replace with Your App name in the Command):
    > heroku git:remote -a YOUR-APP-NAME
    • Use Git to Push the Backend to Heroku:
    > git push heroku master

Go Back
Automatic Deployment of Backend Method
Go to Next Page

Clone this wiki locally