Rack: Fast Modular Ruby Web Server Interface

Post by Hendy Irawan

Permanent Link  |   book mark Rack: Fast Modular Ruby Web Server Interface in del.icio.usClick here to add on del.icio.us

Rack, recently announced at version 0.2 by Christian Neukirchen, is a minimal, modular and adaptable interface for developing Ruby web applications. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call.

A simple Rack application looks like this:

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

If you ever think Rails is a bit overkill for some of your projects, you might just really like Rack. It supports web frameworks such as Camping, Ramaze, Maveric, and Racktools::SimpleApplication. The new version now supports FastCGI in addition to WEBrick, Mongrel/Swiftcore, and plain CGI.

Rack is installable as a Ruby gem:

gem install rack

Check out Chris' blog posts for more detailed information about Rack.

One Response to “Rack: Fast Modular Ruby Web Server Interface”

  1. #1
    johan Says:

    rack has supported fcgi since 0.1