Skip to content

Instantly share code, notes, and snippets.

@jamesmartin
Created March 28, 2011 12:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmartin/890347 to your computer and use it in GitHub Desktop.
Save jamesmartin/890347 to your computer and use it in GitHub Desktop.
Modular sinatra that serves static content from within the '/bar' app
require 'rubygems'
require 'sinatra/base'
class Bar < Sinatra::Base
set :static, true
set :public, File.join(File.dirname(__FILE__), 'bar/_site/')
get '' do
redirect '/bar/'
end
get '/' do
File.read('bar/_site/index.html')
end
end
require 'foo'
require 'bar'
map '/' do
run Foo
end
map '/bar' do
run Bar
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment