Get ordered list of middleware in a generic rack application?

Buzzy picture Buzzy · Oct 24, 2010 · Viewed 15.5k times · Source

The functionality I am looking for is similar to the rake middleware command in Rails, except for a generic rack application.

Answer

Peter Ehrlich picture Peter Ehrlich · Dec 21, 2013
$ rake middleware

use ActionDispatch::Static
use Rack::Lock
use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007ffd148f9468>
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::DebugExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::Migration::CheckPending
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ParamsParser
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
run RackTest::Application.routes

http://pothibo.com/2013/11/ruby-on-rails-inside-actiondispatch-and-rack/