Class: Tpt::Rails::HealthChecksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tpt/rails/health_checks_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/tpt/rails/health_checks_controller.rb', line 4

def index
  results = Tpt::Rails.config.health_checks.check

  healthy = results.values.all?
  code = healthy ? 200 : 500

  render(
    status: code,
    json: {
      healthy: healthy,
      checks: results,
    },
  )
end