Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated readme with my var changes and heroku/mongohq config

  • Loading branch information...
commit 9c8a5a7b4a9e6a60ae1f8b0ef8a968765f1568d9 1 parent 7711205
@portertech portertech authored committed
Showing with 18 additions and 5 deletions.
  1. +18 −5 README.md
View
23 README.md
@@ -35,11 +35,24 @@ All Sinatra options you can set are:
Their default values are:
- ENV['MONGO_HOST'] || 'localhost'
- ENV['MONGO_DB'] || 'changme'
- ENV['MONGO_PORT'] || Mongo::Connection::DEFAULT_PORT
- ENV['MONGO_USER']
- ENV['MONGO_PASSWORD']
+ ENV['MONGOID_HOST'] || 'localhost'
+ ENV['MONGOID_DATABASE'] || 'changme'
+ ENV['MONGOID_PORT'] || Mongo::Connection::DEFAULT_PORT
+ ENV['MONGOID_USERNAME']
+ ENV['MONGOID_PASSWORD']
+
+Heroku & MongoHQ:
+
+require 'uri'
+
+if ENV['MONGOHQ_URL']
+ mongo_uri = URI.parse(ENV['MONGOHQ_URL'])
+ ENV['MONGOID_HOST'] = mongo_uri.host
+ ENV['MONGOID_PORT'] = mongo_uri.port.to_s
+ ENV['MONGOID_USERNAME'] = mongo_uri.user
+ ENV['MONGOID_PASSWORD'] = mongo_uri.password
+ ENV['MONGOID_DATABASE'] = mongo_uri.path.gsub("/", "")
+end
Resources
---------
Please sign in to comment.
Something went wrong with that request. Please try again.