Created
January 4, 2010 19:09
-
-
Save raul/268762 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rack mapping example | |
# run at port 9292 with "rackup config.ru" | |
require 'path_to_my_rails_app/config/environment' | |
app1 = Rack::Builder.new { | |
map "/" do | |
use Rails::Rack::Static | |
run ActionController::Dispatcher.new | |
end | |
}.to_app | |
app2 = Proc.new{ |env| [200, {'Content-Type' => 'text/html'}, "Hi from app 2"] } | |
map "/foo" do | |
run app1 | |
end | |
map "/bar" do | |
run app2 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment