Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add MongoLab support.

  • Loading branch information...
commit 315cb324d21834d504133c35f946537fdeaa906c 1 parent 23ca74b
Jonathan Hoyt authored

Showing 2 changed files with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. +6 2 README.md
  2. +1 1  lib/pdf_archive.rb
8 README.md
Source Rendered
@@ -29,12 +29,16 @@ Running this on Heroku requires the following steps:
29 29 gem install heroku
30 30 heroku apps:create app_name --stack cedar
31 31
32   -### Step 2: Add MongoHQ Addon
  32 +### Step 2: Add a MongoDB Addon
33 33
34   -The MongoHQ Addon will give us a small free MongoDB instance for storing our documents.
  34 +The MongoHQ or MongoLab Addons will give us a small free MongoDB instance for storing our documents.
35 35
36 36 heroku addons:add mongohq:free
37 37
  38 +or
  39 +
  40 + heroku addons:add mongolab:starter
  41 +
38 42 ### Step 3: Configure For S3
39 43
40 44 First setup an Amazon AWS account, get your key, secret, and create a bucket. Then take those values and configure the environment variables on Heroku.
2  lib/pdf_archive.rb
@@ -15,7 +15,7 @@ def self.root
15 15 end
16 16
17 17 # MongoMapper setup
18   -mongo_url = ENV['MONGOHQ_URL'] || "mongodb://localhost:27017/pdf_archive-#{PdfArchive.environment}"
  18 +mongo_url = ENV['MONGOHQ_URL'] || ENV['MONGOLAB_URI'] || "mongodb://localhost:27017/pdf_archive-#{PdfArchive.environment}"
19 19 uri = URI.parse(mongo_url)
20 20 database = uri.path.gsub('/', '')
21 21 MongoMapper.connection = Mongo::Connection.new(uri.host, uri.port, {})

0 comments on commit 315cb32

Please sign in to comment.
Something went wrong with that request. Please try again.