Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
imranansari committed Apr 26, 2013
1 parent 00071cf commit ed9f09f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@

class API < Sinatra::Base


# MongoDB configuration
Mongoid.configure do |config|
if ENV['MONGOHQ_URL']
conn = Mongo::Connection.from_uri(ENV['MONGOHQ_URL'])
uri = URI.parse(ENV['MONGOHQ_URL'])
config.master = conn.db(uri.path.gsub(/^\//, ''))
else
config.master = Mongo::Connection.from_uri("mongodb://localhost:27017").db('test')
end
end

# Models
class Counter
Expand Down

0 comments on commit ed9f09f

Please sign in to comment.