Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/health_check/health_check_routes.rb

Instance Method Summary collapse

Instance Method Details

#add_health_check_routes(prefix = nil) ⇒ Object



10
11
12
13
# File 'lib/health_check/health_check_routes.rb', line 10

def add_health_check_routes(prefix = nil)
  HealthCheck.uri = prefix if prefix
  match "#{HealthCheck.uri}(/:checks)(.:format)", to: 'health_check/health_check#index', via: %i[get post], defaults: { format: 'txt' }
end

#health_check_routes(prefix = nil) ⇒ Object



5
6
7
8
# File 'lib/health_check/health_check_routes.rb', line 5

def health_check_routes(prefix = nil)
  HealthCheck::Engine.routes_explicitly_defined = true
  add_health_check_routes(prefix)
end