From 4770ea6d7a6eaf00cc19bc4fb2afd59071e8cf66 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 11 Nov 2009 19:29:57 -0800 Subject: examples/rails_app-2.3.4: move middleware setup to config.ru config.ru is more obvious and easier to use with non-Rails applications. This is true especially if you want to share the Upr::Monitor object/connection with the upcoming Upr::Streaming JSON application. --- examples/rails_app-2.3.4/config.ru | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'examples/rails_app-2.3.4/config.ru') diff --git a/examples/rails_app-2.3.4/config.ru b/examples/rails_app-2.3.4/config.ru index d51b6b2..dcd7fb5 100644 --- a/examples/rails_app-2.3.4/config.ru +++ b/examples/rails_app-2.3.4/config.ru @@ -1,3 +1,14 @@ require 'config/environment' -use Rails::Rack::Static -run ActionController::Dispatcher.new +# upr defaults to using a Moneta::Memory backend which is good enough +# for single-process/server applications +$upr = Upr::Monitor.new + +map "/" do + use Rack::Chunked + use Rack::ContentLength + use Rack::Deflater + + use Upr, :backend => $upr, :frequency => 1 + use Rails::Rack::Static + run ActionController::Dispatcher.new +end -- cgit v1.2.3-24-ge0c7