Created
February 5, 2009 13:01
-
-
Save diegorv/58703 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 Poller | |
def self.call(env) | |
if env["PATH_INFO"] =~ /^\/poller/ | |
@post = Post.find(1) | |
[200, {"Content-Type" => "text/html"}, @post.title] | |
else | |
[404, {"Content-Type" => "text/html"}, ["Not Found"]] | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment