Class: RailsHealthChecks::HealthController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_health_checks/health_controller.rb

Instance Method Summary collapse

Instance Method Details

#liveObject



10
11
12
13
14
15
16
17
# File 'app/controllers/rails_health_checks/health_controller.rb', line 10

def live
  builder = ResponseBuilder.new(run_checks)
  if builder.overall_status == "ok"
    render plain: "OK", status: :ok
  else
    render plain: "Service Unavailable", status: :service_unavailable
  end
end

#showObject



5
6
7
8
# File 'app/controllers/rails_health_checks/health_controller.rb', line 5

def show
  builder = ResponseBuilder.new(run_checks)
  render json: builder.to_json, status: builder.http_status
end