Created
December 4, 2011 20:08
-
-
Save stevenklise/1431139 to your computer and use it in GitHub Desktop.
Mapping multiple apps with Rack
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' | |
require './index' | |
run Rack::URLMap.new("/" => CoolApp.new, "/ohnice" => BetterApp.new) |
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
class CoolApp < Sinatra::Base | |
get '/' do | |
"Welcome to the internet." | |
end | |
end | |
class BetterApp < Sinatra::Base | |
get '/' do | |
"The time is #{Time.now}." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment