From 3b4a232c4ab6c1c920645d8c596c70a9fb0acaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Meny?= Date: Fri, 28 Jan 2022 09:01:08 +0000 Subject: [PATCH] Add health check (#253) --- config/routes.rb | 2 ++ manifest.yml | 2 ++ spec/features/test_spec.rb | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index 8f7a1db47..40ad98333 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,6 +9,8 @@ Rails.application.routes.draw do get "confirmations/reset", to: "auth/passwords#reset_confirmation" end + get "/health", to: ->(_) { [204, {}, [nil]] } + # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html ActiveAdmin.routes(self) diff --git a/manifest.yml b/manifest.yml index afabbb4f7..8938a313c 100644 --- a/manifest.yml +++ b/manifest.yml @@ -7,6 +7,8 @@ defaults: &defaults command: bundle exec rake cf:on_first_instance db:migrate && bin/rails server instances: 2 memory: 512M + health-check-type: http + health-check-http-endpoint: /health applications: - name: dluhc-core-staging diff --git a/spec/features/test_spec.rb b/spec/features/test_spec.rb index 13e42dee1..556d72a52 100644 --- a/spec/features/test_spec.rb +++ b/spec/features/test_spec.rb @@ -4,4 +4,9 @@ RSpec.describe "Test Features" do visit("/") expect(page).to have_content("Submit social housing lettings and sales data (CORE)") end + + it "Responds to a health check" do + visit("/health") + expect(page).to have_http_status(204) + end end