Skip to content

Connecting to Heroku

Alon Talmor edited this page Dec 4, 2017 · 1 revision

created by @alonttal

Hi, after trying to open an aws accout, I was shocked to find out that real phone number and credit card number are required. After calming down, i decided not to give them this valuable piece of information and open webservice on different vendor. I went on Heroku since it's easy to register and completely free (for the basic package). I think it is a much better alternative at this stage. site: https://www.heroku.com/

Install heroku tool goto: toolbelt.heroku.com and download the toolbelt for your OS. All this is gonna do is add new commands for the terminal. to check if it's working type: heroku --help in the terminal. It will also install the heroku CLI in the terminal.

now run heroku login and type in Email: RoommatesYearlyProject@gmail.com Password: ********

after logging in we can deploy application into heroku.

I edited server.js so port is to be listened differently when running from different mahines:

  • on localhost using port 3000.
  • on heroku using port in env variable PORT.

In package.json file I added: "start": "node server.js" under scripts. heroku will run this command to start the server.

Next we need to run "heroku create" from application directory. This gonna add new remote to git repository. This will allow us to push to heroku using "git push heroku". you should see "remote: Verifying deploy... done." if everythign went well. You should also see "remote: https://powerful-tundra-42649.herokuapp.com/ deployed to Heroku". This is our site url.

Regards

Clone this wiki locally