1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Using Rack Middleware


3 of 4

Default Rack Middleware

By default, Rackup already adds on some middleware applications. Depending on whether the environment option is set to development, deployment or none, the following middleware applications will be running.

  • Development: CommonLogger, ShowExceptions, and Lint

  • Deployment: CommonLogger

  • None: none

Note that all the middleware that goes on to your application is a chain of middleware applications. In a application running in Rackup’s development configuration, a request is first passed to CommonLogger, then to ShowExceptions, then to Lint, and finally to your application. Further, these applications can either first pass the request down the chain and then do something to the response, do something to the request before passing it on, or both. Also, middleware doesn’t have to pass your application’s response back at all. For example, the Lint middleware will discard your response and pass an error message to the web server if something is wrong with your response.

  1. About.com
  2. Technology
  3. Ruby
  4. Networking
  5. Rack
  6. Default Rack Middleware

©2014 About.com. All rights reserved.