Rack (web server interface)
Stable release | 1.0.0
/ May 25, 2009 |
---|---|
Repository | |
Operating system | Cross-platform |
Type | Middleware |
License | MIT License |
Website | http://rack.rubyforge.org/ |
Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. 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.
Example Application
A Rack-compatible "Hello World" application in Ruby syntax:
require 'rack'
app = Rack::Builder.app do
lambda do |env|
body = "Hello, World!"
[200, {"Content-Type" => "text/plain", "Content-Length" => body.length.to_s}, [body]]
end
end