-
-
Save bmizerany/37672 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
class App1 < Sinatra::Base | |
set :views, "/path/to/views" | |
set :public, "/path/to/static/files" | |
def strong(text) | |
"<strong>#{text}</strong>" | |
end | |
get '/' do | |
strong "Hello World" | |
end | |
end | |
class App2 < Sinatra::Base | |
set :views, "/path/to/more/views" | |
set :public, "/path/to/more/static/files" | |
def em(text) | |
"<em>#{text}</em>" | |
end | |
get '/' do | |
em "Hello World" | |
end | |
end | |
class Middleware < Sinatra::Base | |
get '/foo/bar' do | |
@app.call(env) | |
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
use Sinatra::Base do | |
get '/' do | |
... do cool shit ... | |
@app.call | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment