Created
May 13, 2011 03:06
-
-
Save sj26/969897 to your computer and use it in GitHub Desktop.
Multiple rack applications mounted inside each other
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
require 'rack' | |
use Rack::ContentLength | |
use Rack::ContentType | |
run proc { |env| [200, {}, '<p>First application</p><p><a href="/bar">Go to Second Application</a></p>'] } |
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
require 'rack' | |
use Rack::ContentLength | |
use Rack::ContentType | |
run proc { |env| [200, {}, '<p>Second application</p><p><a href="/">Go to First Application</a></p>'] } |
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
require 'rack' | |
run Rack::URLMap.new \ | |
"/" => Rack::Builder.parse_file('app1.ru').first, | |
"/bar" => Rack::Builder.parse_file('app2.ru').first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment