Skip to content

Commit

Permalink
Fix obscure bug
Browse files Browse the repository at this point in the history
  • Loading branch information
santib committed Nov 10, 2023
1 parent 474ded6 commit bc3115d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 0 additions & 4 deletions app/controllers/api/v1/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class ApiController < ActionController::API
rescue_from ActiveRecord::RecordInvalid, with: :render_record_invalid
rescue_from ActionController::ParameterMissing, with: :render_parameter_missing

def status
render json: { online: true }
end

private

def render_not_found(exception)
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/api/v1/health_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Api
module V1
class HealthController < Api::V1::ApiController
def status
render json: { online: true }
end
end
end
end
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace :api do
namespace :v1, defaults: { format: :json } do
get :status, to: 'api#status'
get :status, to: 'health#status'

devise_scope :user do
resource :user, only: %i[update show]
Expand Down

0 comments on commit bc3115d

Please sign in to comment.