Skip to content

Instantly share code, notes, and snippets.

@RafeHatfield
Last active December 19, 2015 14:39
Show Gist options
  • Save RafeHatfield/5971147 to your computer and use it in GitHub Desktop.
Save RafeHatfield/5971147 to your computer and use it in GitHub Desktop.

Clone the uptime repository

$ git clone https://github.com/fzaninotto/uptime.git

Run this command to create the Procfile:

$ echo "web: node app.js" > Procfile

Commit your changes

$ git add .
$ git commit -m 'Added Procfile'

Create your heroku app

$ heroku create 

Add MongoDB to your app

$ heroku addons:add mongolab

Get your MongoDB connection info

$ heroku config
  === appName Config Vars
  MONGOLAB_URI: mongodb://username:password@host:port/dbname
  PATH:         bin:node_modules/.bin:/usr/local/bin:/usr/bin:/bin

Use the info you just got and update `config/default.yml':

mongodb:
  server: host:port
  database: dbname
  user:     username
  password: password

I've also updated other settings

monitor:
  apiUrl: 'http://appname.herokuapp.com/api' # must be accessible without a proxy

server:
  port:     80
  
email:
  dashboardUrl: 'http://appname.herokuapp.com'

Commit your changes

$ git add .
$ git commit -m 'Updated the configurations'

Push your files

$ git push heroku master

Make sure there's one dyno running for the web:

$ heroku ps:scale web=1

You can verify it's running using

$ heroku ps
=== web (1X): `node app.js`
web.1: up 2013/06/28 19:03:30 (~ 3m ago)	

Open your app

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