Created
March 28, 2011 12:07
-
-
Save jamesmartin/890347 to your computer and use it in GitHub Desktop.
Modular sinatra that serves static content from within the '/bar' 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 '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 |
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 '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