Sha256: dcce047098988537edb887ec8f467cd7f7bc3925dd506b3088e9859cfe457116

Contents?: true

Size: 424 Bytes

Versions: 1

Compression:

Stored size: 424 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
micropub-server-rails-0.1.2 lib/micropub/server/rails/middleware.rb