Browse Source

Add health check (#253)

pull/254/head
Stéphane Meny 3 years ago committed by GitHub
parent
commit
3b4a232c4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      config/routes.rb
  2. 2
      manifest.yml
  3. 5
      spec/features/test_spec.rb

2
config/routes.rb

@ -9,6 +9,8 @@ Rails.application.routes.draw do
get "confirmations/reset", to: "auth/passwords#reset_confirmation" get "confirmations/reset", to: "auth/passwords#reset_confirmation"
end end
get "/health", to: ->(_) { [204, {}, [nil]] }
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
ActiveAdmin.routes(self) ActiveAdmin.routes(self)

2
manifest.yml

@ -7,6 +7,8 @@ defaults: &defaults
command: bundle exec rake cf:on_first_instance db:migrate && bin/rails server command: bundle exec rake cf:on_first_instance db:migrate && bin/rails server
instances: 2 instances: 2
memory: 512M memory: 512M
health-check-type: http
health-check-http-endpoint: /health
applications: applications:
- name: dluhc-core-staging - name: dluhc-core-staging

5
spec/features/test_spec.rb

@ -4,4 +4,9 @@ RSpec.describe "Test Features" do
visit("/") visit("/")
expect(page).to have_content("Submit social housing lettings and sales data (CORE)") expect(page).to have_content("Submit social housing lettings and sales data (CORE)")
end end
it "Responds to a health check" do
visit("/health")
expect(page).to have_http_status(204)
end
end end

Loading…
Cancel
Save