Skip to content

Instantly share code, notes, and snippets.

@raul
Created January 4, 2010 19:09
Show Gist options
  • Save raul/268762 to your computer and use it in GitHub Desktop.
Save raul/268762 to your computer and use it in GitHub Desktop.
# 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