Created
November 15, 2009 14:00
-
-
Save secretfader/235233 to your computer and use it in GitHub Desktop.
multiple, nested apps in Sinatra
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 'rubygems' | |
require 'sinatra/base' | |
class AppNumberOne < Sinatra::Base | |
get '/?' do | |
"You've found App1. Go to /app2/ to find App2!" | |
end | |
end |
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 'rubygems' | |
require 'sinatra/base' | |
class AppNumberTwo < Sinatra::Base | |
get '/?' do | |
"Ooh! Ya found me!" | |
end | |
end |
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 'AppNumberOne' | |
require 'AppNumberTwo' | |
map '/app1' do | |
run App1 | |
end | |
map '/app2' do | |
run App2 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment