An open API service indexing awesome lists of open source software.

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).

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