Created
December 16, 2008 23:29
-
-
Save samgranieri/36861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow the metal piece to run in isolation | |
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails) | |
class Pulse < Rails::Rack::Metal | |
def call(env) | |
if env["PATH_INFO"] =~ /^\/heartbeat/ | |
[200, {"Content-Type" => "text/html"}, (1..10).to_a.to_sentence] | |
else | |
super | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment