racking routes up without session and flash

New routing allows to use rack applications as endpoints like this:

match '/discovery', :to => DiscoveryService match '/logging', :to => LoggingService

But given the middleware stack that I see, it's not obvious how I can skip things like cookies, session, flash and parameter parsing which I may not want to use with my rack apps.

use ActionDispatch::Static use Rack::Lock use ActiveSupport::Cache::Strategy::LocalCache use Rack::Runtime use Rails::Rack::Logger use ActionDispatch::ShowExceptions use ActionDispatch::RemoteIp use Rack::Sendfile use ActionDispatch::Callbacks use ActiveRecord::QueryCache use ActionDispatch::Cookies use ActionDispatch::Session::CookieStore use ActionDispatch::Flash use ActionDispatch::ParamsParser use Rack::MethodOverride use ActionDispatch::Head run DemoApp::Application.routes

The only option I can come up with is to insert custom middleware handler, say, right after QueryCache and do traditional "intercept or pass through" trick. But that would omit all the routes.rb hotness. And in cases with multiple endpoints it would spawn another code with routing responsibility (and possibly configuration).

Is there a good way to have new routing for rack apps in routes.rb and stay free from unnecessary middleware at the same time?