Class: Gris::Middleware::Health

Inherits:
Object
  • Object
show all
Defined in:
lib/gris/middleware/health.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Health

Returns a new instance of Health.



4
5
6
# File 'lib/gris/middleware/health.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/gris/middleware/health.rb', line 8

def call(env)
  if ['/health', '/health.json'].include? env['PATH_INFO']
    [200, { 'Content-type' => 'application/json' }, [Gris::Identity.health.to_json]]
  else
    @app.call(env)
  end
end