Class: HealthyRack::App

Inherits:
Object
  • Object
show all
Defined in:
lib/healthy_rack/app.rb

Constant Summary collapse

HEADERS =
{
  'Content-Type' => 'application/json; charset=UTF-8'
}.freeze

Class Method Summary collapse

Class Method Details

.call(_env) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/healthy_rack/app.rb', line 10

def call(_env)
  failed_checks = HealthyRack.config.checks.reject(&:call)
  if failed_checks.any?
    [500, HEADERS.dup, [error_response_body(failed_checks)]]
  else
    [200, HEADERS.dup, [successful_response_body]]
  end
end