Rack: Fast Modular Ruby Web Server Interface
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.
May 27, 2007 at 6:36 pm
rack has supported fcgi since 0.1