Class: MicroApi::StaticController

Inherits:
ApplicationController show all
Defined in:
app/controllers/micro_api/static_controller.rb

Instance Method Summary collapse

Instance Method Details

#healthzObject



3
4
5
6
7
8
# File 'app/controllers/micro_api/static_controller.rb', line 3

def healthz
  render json: {
    db: active_record_check,
    status: :ok
  }
end

#no_route_matchesObject



20
21
22
23
# File 'app/controllers/micro_api/static_controller.rb', line 20

def no_route_matches
  exception = ActionController::RoutingError.new("No route matches [#{request.method}] #{request.path}")
  render json: { error: exception.message }, status: :not_found
end

#versionObject



10
11
12
13
14
15
16
17
18
# File 'app/controllers/micro_api/static_controller.rb', line 10

def version
  render json: {
    ac:   Rails.application.class.to_s.split("::").first, # app code
    cenv: ENV.fetch("CLOUD_ENV", "local"),                # cloud env
    env:  Rails.env,                                      # rails env
    av:   app_version,
    itag: ENV.fetch("IMAGE_TAG", nil),                    # image tag
  }
end