Permalink
Browse files

example rack app

  • Loading branch information...
1 parent e227afe commit d753ea57ac7e1349ebfb6ad8b0aff9d59fb5e253 @igrigorik committed Jan 9, 2011
Showing with 24 additions and 1 deletion.
  1. +23 −0 examples/rackapp.rb
  2. +1 −1 lib/rack/aggregate/version.rb
View
@@ -0,0 +1,23 @@
+require 'rubygems'
+require 'rack'
+
+$LOAD_PATH.unshift 'lib'
+$LOAD_PATH.unshift 'examples'
+
+require 'rack/aggregate'
+
+class SomeApp
+ def call(env)
+ sleep(rand(10))
+ [200, {"Content-Type" => "text/plain"}, "Hello World"]
+ end
+end
+
+builder = Rack::Builder.new do
+ use Rack::CommonLogger
+ use Rack::Aggregate
+
+ run SomeApp.new
+end
+
+Rack::Handler::Thin.run builder.to_app, :Port => 4567
@@ -1,5 +1,5 @@
module Rack
module Aggregate
- VERSION = "0.0.1"
+ VERSION = "0.1.0"
end
end

0 comments on commit d753ea5

Please sign in to comment.