https://github.com/grimen/rack-alive
Rack middleware for checking if app is alive or not - optionally via custom condition(s).
https://github.com/grimen/rack-alive
Last synced: 3 months ago
JSON representation
Rack middleware for checking if app is alive or not - optionally via custom condition(s).
- Host: GitHub
- URL: https://github.com/grimen/rack-alive
- Owner: grimen
- License: mit
- Created: 2011-09-18T21:01:17.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-09-29T12:02:00.000Z (over 14 years ago)
- Last Synced: 2025-02-01T21:06:28.307Z (11 months ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/rack-alive
- Size: 91.8 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: MIT-LICENSE
Awesome Lists containing this project
README
h1. RACK-ALIVE "!https://secure.travis-ci.org/merchii/rack-alive.png!":http://travis-ci.org/merchii/rack-alive
_Rack middleware for checking if app is alive or not - optionally via custom condition(s)._
h2. Installation
Add to your @Gemfile@:
gem 'rack-alive'
...and @bundle install@.
h2. Usage
*Minimal:*
require 'rack/alive'
use Rack::Alive
*Advanced:*
require 'rack/alive'
use Rack::Alive, proc {
# Test DB-connection.
db_alive =
begin
ActiveRecord::Base.connection.select_all('select 1')
true
rescue
false
end
# Check that you got all horses/unicorns in the stable...or something.
got_all_horses = ENV['HORSES_IN_THE_STABLE'].to_i == 5
db_alive && got_all_horses
}
h2. Test
GET /alive?
h2. Notes
This gem was developed for our own requirements at *"Merchii":http://github.com/merchii*, so feel free to send pull-requests with enhancements of any kind (features, bug-fixes, documentation, tests, etc.) to make it better or useful for you as well.
h2. License
Released under the MIT license.
Copyright (c) "Jonas Grimfelt":http://github.com/grimen, "Merchii":http://github.com/merchii