Created
July 30, 2009 16:04
-
-
Save vangberg/158754 to your computer and use it in GitHub Desktop.
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
# This is our base controller, much like ApplicationController in Rails | |
class App < Sinatra::Base | |
# Default settings that should be shared by all controllers | |
set :foo, :bar | |
def shared_helper | |
# this will be available for everything | |
end | |
end | |
class Users < App | |
get '/' do | |
... | |
end | |
post '/' do | |
... | |
end | |
end | |
class Comments < App | |
get '/' do | |
... | |
end | |
post '/' do | |
... | |
end | |
end |
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
require 'app' | |
map('/users') { run Users } | |
map('/comments') { run Comments } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment