Ruby rack

From wikinotes

A library for working with HTTP requests.

Usage

Rack Interface

Rack expects code that works with it to use the method call which returns a list with status, headers, body.

require "rack"
require "thin"

class HelloWorld
  def call(env)
    [ 200, { "Content-Type" => "text/plain" }, ["Hello World"] ]
  end
end

Rack::Handler::Thin.run HelloWorld.new