Class: HealthRails::HealthController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/health_rails/health_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /health



5
6
7
8
9
10
11
12
# File 'app/controllers/health_rails/health_controller.rb', line 5

def index
  health_check = HealthRails::HealthCheck.new
  if health_check.all_ok?
    render text: "All OK"
  else
    render text: health_check.error_messages, status: :service_unavailable
  end
end