Skip to content

Instantly share code, notes, and snippets.

@lyonsinbeta
Created September 30, 2014 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyonsinbeta/26f8d26a50399e5c979e to your computer and use it in GitHub Desktop.
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.
require 'sinatra/base'
class App < Sinatra::Base
get '/' do
'app'
end
end
require 'sinatra/base'
class Bar < Sinatra::Base
get '/' do
'bar'
end
end
require './app'
require './foo'
require './bar'
map('/foo') { run Foo }
map('/bar') { run Bar }
run App
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