Created
September 30, 2014 03:38
-
-
Save lyonsinbeta/26f8d26a50399e5c979e to your computer and use it in GitHub Desktop.
The basics of having entirely separate Sinatra apps running on the same server.
This file contains hidden or 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 'sinatra/base' | |
class App < Sinatra::Base | |
get '/' do | |
'app' | |
end | |
end |
This file contains hidden or 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 'sinatra/base' | |
class Bar < Sinatra::Base | |
get '/' do | |
'bar' | |
end | |
end |
This file contains hidden or 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 './app' | |
require './foo' | |
require './bar' | |
map('/foo') { run Foo } | |
map('/bar') { run Bar } | |
run App |
This file contains hidden or 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 'sinatra/base' | |
class Foo < Sinatra::Base | |
get '/' do | |
'foo' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment