![beyond the rack app trouble beyond the rack app trouble](https://images.routledge.com/common/jackets/crclarge/978036726/9780367262143.jpg)
Rack::Reloader, for reloading files if they have been modified. Rack::Recursive, for including data from other paths in the application, and for performing internal redirects. Rack::MethodOverride, for modifying the request method based on a submitted parameter. Rack::Logger, for setting a logger to handle logging errors. Rack::Lock, for serializing requests using a mutex. Rack::Lint, for checking conformance to the Rack API. Rack::Head, for returning an empty body for HEAD requests. Rack::Events, for providing easy hooks when a request is received and when the response is sent. Rack::ETag, for setting ETag header on string bodies. Rack::Deflater, for compressing responses with gzip. Rack::ContentType, for setting default Content-Type header for responses. Rack::ContentLength, for setting Content-Length header based on body size. Rack::Config, for modifying the environment before processing the request. Rack::ConditionalGet, for returning not modified responses when the response has not changed. Rack::CommonLogger, for creating Apache-style logfiles. Rack::Chunked, for streaming responses using chunked encoding. Rack itself ships with the following middleware: These frameworks and many others support the Rack API:īetween the server and the framework, Rack can be customized to your applications needs using middleware. Phusion Passenger (which is mod_rack for Apache and for nginx)Īny valid Rack app will run the same on all these handlers, without changing anything. These web servers include Rack handlers in their distributions: The included handlers connect all kinds of web servers to Rack:
The exact details of this are described in the Rack specification, which all Rack applications should conform to.
#Beyond the rack app trouble software#
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. Rack provides a minimal, modular, and adaptable interface for developing web applications in Ruby.