diff --git a/app/controllers/health_check_controller.rb b/app/controllers/health_check_controller.rb new file mode 100644 index 000000000..7fa247be2 --- /dev/null +++ b/app/controllers/health_check_controller.rb @@ -0,0 +1,5 @@ +class HealthCheckController < ApplicationController + def index + render :plain => "OK" + end +end diff --git a/config/environments/production.rb b/config/environments/production.rb index 1a5ec07c5..946d60dcb 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -2,6 +2,7 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. config.force_ssl = true + config.ssl_options = { redirect: { exclude: -> request { request.path =~ /healthcheck/ } } } # Code is not reloaded between requests. config.cache_classes = true diff --git a/config/routes.rb b/config/routes.rb index 1697cb1b1..a62838c23 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,5 @@ Rails.application.routes.draw do + get "/healthcheck" => "health_check#index" + root 'application#app' end