Class: Rack::Philae

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/philae_rack.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, prober) ⇒ Philae

Returns a new instance of Philae.



3
4
5
6
# File 'lib/rack/philae_rack.rb', line 3

def initialize(app, prober)
  @app = app
  @prober = prober
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/rack/philae_rack.rb', line 8

def call(env)
  if env['PATH_INFO'] == '/_health'
    [200, { 'Content-type' => 'application/json' }, [@prober.check.to_json]]
  else
    @app.call(env)
  end
end