module Micropub::Server::Rails class Middleware def initialize(app) @app = app end def call(env) if env["PATH_INFO"] == "/micropub" [200, self.headers, ["I am micropub."]] else @app.call env end end def headers { "Location" => "http://bookisworthy.com/posts/1", "Content-Type" => "text/plain; charset=utf-8" } end end end