From c5def7b7b3b98462e9a2e7896dc11aaec1a48b3f Mon Sep 17 00:00:00 2001 From: rewonc Date: Thu, 16 Oct 2014 09:14:27 -0700 Subject: [PATCH] Checks for a MONGOLAB_URI in secrets.js to integrate with heroku addon Edits documentation to describe 1 step heroku deployment removes osx from toolbelt link per PR comment --- README.md | 19 +++++++++++-------- config/secrets.js | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 22a2f28259..b4bdc05dcb 100644 --- a/README.md +++ b/README.md @@ -1073,10 +1073,18 @@ Deployment ---------- Once you are ready to deploy your app, you will need to create an account with a cloud platform to host it. These are not -the only choices, but they are my top picks. Create an account with **MongoLab** and then pick one of the 4 providers -below. Once again, there are plenty of other choices and you are not limited to just the ones listed below. From my -experience, **Heroku** is the easiest to get started with, it will automatically restart your node.js process when it crashes, custom domain support on free accounts and zero-downtime deployments. +the only choices, but they are my top picks. From my experience, **Heroku** is the easiest to get started with, it will automatically restart your node.js process when it crashes, custom domain support on free accounts and zero-downtime deployments. Additionally, you can create an account with **MongoLab** and then pick one of the 3 providers +below. Once again, there are plenty of other choices and you are not limited to just the ones listed below. +###One step deployment with Heroku + +- Download and install [Heroku Toolbelt](https://toolbelt.heroku.com/) +- In terminal, run `heroku login` and enter your Heroku credentials +- From *your app* directory run `heroku create` +- Run `heroku addons:add mongolab` to set up Mongo and configure your environment variables +- Lastly, do `git push heroku master`. Done! + +###Deploying with MongoLab and another cloud provider - Open [mongolab.com](https://mongolab.com) website - Click the yellow **Sign up** button @@ -1097,11 +1105,6 @@ experience, **Heroku** is the easiest to get started with, it will automatically > **:exclamation:Note:** As an alternative to MongoLab, there is also [MongoHQ](http://www.mongohq.com/home). - -- Download and install [Heroku Toolbelt](https://toolbelt.heroku.com/osx) -- In terminal, run `heroku login` and enter your Heroku credentials -- From *your app* directory run `heroku create`, followed by `git push heroku master` -- Done! - First, install this Ruby gem: `sudo gem install rhc` :gem: diff --git a/config/secrets.js b/config/secrets.js index a3eb5c94bb..d1eec86a67 100644 --- a/config/secrets.js +++ b/config/secrets.js @@ -18,7 +18,7 @@ module.exports = { - db: process.env.MONGODB|| 'mongodb://localhost:27017/test', + db: process.env.MONGOLAB_URI || process.env.MONGODB || 'mongodb://localhost:27017/test', sessionSecret: process.env.SESSION_SECRET || 'Your Session Secret goes here',