Skip to content

Instantly share code, notes, and snippets.

@comphonia
Last active December 26, 2018 20:10
Show Gist options
  • Save comphonia/71389de31a7ebddfcf27d038010c585b to your computer and use it in GitHub Desktop.
Save comphonia/71389de31a7ebddfcf27d038010c585b to your computer and use it in GitHub Desktop.
How to deploy an app to Heroku

Heroku is a hosted platform which lets you deploy apps from different languages; Python, Ruby, Node etc. It is a quick way to get your app

online without the hassle of setting up a server.

To get Started:

Install GIT

Install the Heroku Toolbelt

Set Port:

var port = process.env.PORT || 3000 {listen on port}

Commit your files/folders

`cd myapp

git init

Initialized empty Git repository in .git/

git add .

git commit -m "My first commit"`

Add engine to package.json

  "engines":{
  
    "node":"10.12.0"
    
  }

Add a Procfile (processfile)

{process}: {command to run}

web: node app.js

||commit changes

Create app on heroku

heroku create {app_name}

Deploy

git push heroku master

Push

git push heroku master

Test Locally

heroku local

Test Live

heroku open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment