Rack (Webserver-Interface)

Rack presented provides a minimal, modular and adaptive interface for the development of Web applications in the programming language Ruby. By wrapping HTTP requests and HTTP responses, which takes place in the simplest way possible, it unifies the interface for web servers, web frameworks, and software in between, so-called middleware, and distilled these accesses to a single method call.

Rack is used in almost all web frameworks and Weblibraries in the Ruby world, for example by Ruby On Rails and Sinatra. It is available as a Ruby Gem.

Rack has already inspired a framework in the JavaScript world ( jackjs ) and one in the Perl world ( Plack ) and represents a de facto standard rack compatibility (English " rack - compliant" ) in the Ruby world is.

Example Application

A rack -compatible "Hello World " application in Ruby syntax:

App = lambda do | env |    body = "Hello, World!"    [200, {" Content-Type" => " text / plain ", " Content-Length " => body.length.to_s }, [body ] ] end   run app see also

668794
de