Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get ordered list of middleware in a generic rack application?

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

like image 867
Buzzy Avatar asked Oct 24 '10 11:10

Buzzy


People also ask

What is middleware rack?

Rack middleware is a way to filter a request and response coming into your application. A middleware component sits between the client and the server, processing inbound requests and outbound responses, but it's more than interface that can be used to talk to web server.

What is a rack based application?

Rack is a modular interface between web servers and web applications developed in the Ruby programming language. With Rack, application programming interfaces (APIs) for web frameworks and middleware are wrapped into a single method call handling HTTP requests and responses.

What is rack in ROR?

Rack provides a minimal, modular, and adaptable interface for developing web applications in Ruby. 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.


1 Answers

$ 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/

like image 176
Peter Ehrlich Avatar answered Sep 28 '22 20:09

Peter Ehrlich