# A simple example of mounting multiple Sinatra apps in config.ru # MODIFIED: uses Rack::Cascade # To run this example: # 1. put this code in a config.ru file # 2. run "shotgun" on the command line (http://github.com/rtomayko/shotgun) # 3. go to http://localhost:9393/ require 'sinatra/base' class MoonApp < Sinatra::Base get '/moon' do "Howard Moon" end get '/' do env['moon.message'] = "Hello from Moon" # pass [404, {}, []] # return 404 instead of invoking "pass" end end class NoirApp < Sinatra::Base get '/noir' do "Vince Noir" end get '/' do env['moon.message'] # set in MoonApp end end # use MoonApp # run NoirApp run Rack::Cascade.new [MoonApp, NoirApp]