Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Multiple rack applications mounted inside each other

View app1.ru
1 2 3 4 5 6
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>'] }
View app1.ru
1 2 3 4 5 6
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>'] }
View app1.ru
1 2 3 4 5
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
Something went wrong with that request. Please try again.