Class: Norikra::RPC::Gatekeeper

Inherits:
Object
  • Object
show all
Defined in:
lib/norikra/rpc/gatekeeper.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Gatekeeper

handler of “GET /” to respond for monitor tools



8
9
10
# File 'lib/norikra/rpc/gatekeeper.rb', line 8

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
# File 'lib/norikra/rpc/gatekeeper.rb', line 12

def call(env)
  if env["REQUEST_METHOD"] == 'GET' && env["PATH_INFO"] == '/'
    return [ 200, {'Content-Type' => 'text/plain'}, ['Norikra alive!'] ]
  end
  return @app.call(env)
end