Upload
simon-courtois
View
384
Download
0
Embed Size (px)
Citation preview
@happynoff http://www.tinci.fr
Web Server Your Ruby ApplicationRack
Yup!Here you go!
Huh, I've this request… Do you
know what it's about?!
@happynoff http://www.tinci.fr
Web Server Your Ruby Application
Huh, I've this request… Do you
know what it's about?!
Rack
Well, let me check…
@happynoff http://www.tinci.fr
Web Server Rack
Hey girl, there's this guy asking about a request and all…
Your Ruby Application
Of course! Here's for you.
Have fun!
@happynoff http://www.tinci.fr
Web Server Your Ruby Application
Thanks, you're very kind.
Rack
Ok! Here is what I've made for
you.
@happynoff http://www.tinci.fr
Rack
Middleware
Middleware
Middleware
Middleware
Middleware
server
app
@happynoff http://www.tinci.fr
Rack
Middleware
Middleware
Middleware
Middleware
Middleware
app
server
@happynoff http://www.tinci.fr
class MyMiddleware def initialize(app) @app = app end
def call(env) @app.call(env) end end
@happynoff http://www.tinci.fr
class Trollware def initialize(app) @app = app end
def call(env) status, headers, resp = @app.call(env) ["404", headers, resp.body] end end
@happynoff http://www.tinci.fr
use Rack::Sendfile use ActionDispatch::Static use Rack::Lock use #<ActiveSupport::Cache::Strategy::…> use Rack::Runtime use Rack::MethodOverride use ActionDispatch::RequestId use Rails::Rack::Logger use ActionDispatch::ShowExceptions use WebConsole::Middleware use ActionDispatch::DebugExceptions use ActionDispatch::RemoteIp use ActionDispatch::Reloader use ActionDispatch::Callbacks use ActiveRecord::Migration::CheckPending use ActiveRecord::ConnectionAdapters::… 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 MyApp::Application.routes