HealthRack
Easily add a health status page to your rack-compatible application.
Installation
Add this line to your application's Gemfile:
gem 'health_rack'
And then execute:
$ bundle
Or install it yourself as:
$ gem install health_rack
Usage
Add a class containing the various checks you would like to perform.
class Health < HealthRack::Base
check "Database" do
# Add code to check connectivity to database
end
check "Lemons" do
true
end
end
run Health.new
Then mount the health check in your routes
mount HealthStatus.new, at: '/health'
Visiting that path in a browser will perform the health check and present the output.
There is also the option of adding .json
to the path to generate json output.
Contributing
- Fork it ( https://github.com/everydayhero/health_rack/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request