genghis icon indicating copy to clipboard operation
genghis copied to clipboard

passing MongoDB server details to genghis - ruby

Open czerasz opened this issue 10 years ago • 2 comments

How can I tell genghis about my MongoDB server details?

What I mean is something like this:

require 'genghis'
require File.expand_path('../app/app.rb', __FILE__)

run Rack::URLMap.new \
  '/'        => Company::App::Server.new,
  '/genghis' => Genghis::Server.new("10.0.10.1:27017")

czerasz avatar Nov 14 '14 09:11 czerasz

It's not possible to pass it to the constructor, but that's a great idea. I'll look into getting something into the next version.

In the meantime, you can set ENV['GENGHIS_SERVERS'] to your server URI and it'll do the same thing.

bobthecow avatar Nov 14 '14 20:11 bobthecow

Thx for the great tip @bobthecow.

Used the following code and it worked like a charm:

require 'genghis'
require File.expand_path('../app/app.rb', __FILE__)

ENV['GENGHIS_SERVERS'] = "10.0.10.1:27017"

run Rack::URLMap.new \
  '/'        => Company::App::Server.new,
  '/genghis' => Genghis::Server.new

czerasz avatar Nov 14 '14 20:11 czerasz