Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding an ENV variable GOLIATH_ENV to make server env agnostic
swap out /v1/users in favor of /v1/categories bundle update : +++ b/Gemfile.lock + addressable (2.3.2) + em-websocket (0.3.8) + addressable (>= 2.1.1) + eventmachine (>= 0.12.9) + goliath (1.0.0) + em-websocket + eventmachine (>= 1.0.0.beta.4) + http_parser.rb (= 0.5.3)
- Loading branch information
Showing
4 changed files
with
37 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
web: bundle exec ruby app.rb -sv -e prod -p $PORT | ||
web: bundle exec ruby app.rb -sv -e $GOLIATH_ENV -p $PORT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
#this should live in a file called app.rb inside a directory called 'config' | ||
|
||
#config['mongo'] = EventMachine::Synchrony::ConnectionPool.new(size: 20) do | ||
# conn = EM::Mongo::Connection.new('localhost', 27017, 1, {:reconnect_in => 1}) | ||
# conn.db('db') | ||
#nd | ||
|
||
config['mongo'] = EventMachine::Synchrony::ConnectionPool.new(size: 20) do | ||
mongolab = URI.parse(ENV['MONGOLAB_URI']) | ||
conn = EM::Mongo::Connection.new mongolab.host, mongolab.port, 1, {:reconnect_in => 1} | ||
|
||
db = conn.db mongolab.path.gsub(/^\//, '') | ||
db.authenticate mongolab.user, mongolab.password | ||
db | ||
environment :development do | ||
config['mongo'] = EventMachine::Synchrony::ConnectionPool.new(size: 20) do | ||
conn = EM::Mongo::Connection.new('localhost', 27017, 1, {:reconnect_in => 1}) | ||
conn.db('db') | ||
end | ||
end | ||
|
||
environment :production do | ||
config['mongo'] = EventMachine::Synchrony::ConnectionPool.new(size: 20) do | ||
mongolab = URI.parse(ENV['MONGOLAB_URI']) | ||
conn = EM::Mongo::Connection.new mongolab.host, mongolab.port, 1, {:reconnect_in => 1} | ||
|
||
db = conn.db mongolab.path.gsub(/^\//, '') | ||
db.authenticate mongolab.user, mongolab.password | ||
db | ||
end | ||
end | ||
|