Created
February 1, 2012 19:15
-
-
Save achiurizo/1718723 to your computer and use it in GitHub Desktop.
sinatra hack to mount via padrino mount
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
# foo.rb | |
class Foo < ::Sinatra::Base | |
class << self | |
def dependencies; []; end | |
def setup_application!; end | |
end | |
get '/' do | |
'wubwub' | |
end | |
end | |
# config/apps.rb | |
Padrino.mount("Main::App", :app_file => File.expand_path('../app/app.rb', __FILE__).to('/') | |
Padrino.mount("Foo", :app_file => File.expand_path('../foo.rb', __FILE__).to('/foo') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another method we should define is
def reoad!; end
. Prevents error when reloading the app.Thanks for the hack!