Class: ServerHealthCheckRails::HealthController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
# File 'app/controllers/server_health_check_rails/health_controller.rb', line 3

def index
  check = ServerHealthCheckRails::HealthCheck.all
  render status: check.http_status, json: check.to_h
end

#showObject



8
9
10
11
# File 'app/controllers/server_health_check_rails/health_controller.rb', line 8

def show
  check = ServerHealthCheckRails::HealthCheck.new(params[:id])
  render status: check.http_status, json: check.to_h
end