Rack: Fast Modular Ruby Web Server Interface
By Hendy Irawan / May 27, 2007
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.
About Hendy Irawan
Ruby programmer from Indonesia. View all posts by Hendy Irawan →Comments
-
johan says:
May 27, 2007 at 6:36 pmrack has supported fcgi since 0.1
Other Posts to Enjoy
-
Ruby’s Unary Operators and How to Redefine Their Functionality
Ruby’s Unary Operators and How to Redefine Their Functionality
-
The Split is Not Enough: Unicode Whitespace Shenigans for Rubyists
The Split is Not Enough: Unicode Whitespace Shenigans for Rubyists
-
The Mega Ruby News and Release Roundup for February 2012
The Mega Ruby News and Release Roundup for February 2012
-
A Lagom Review of O’Reilly’s ‘Sinatra Up and Running’
A Lagom Review of O’Reilly’s ‘Sinatra Up and Running’