Skip to content

Instantly share code, notes, and snippets.

@bmizerany
Forked from rtomayko/gist:37668
Created December 18, 2008 21:32
Show Gist options
  • Save bmizerany/37672 to your computer and use it in GitHub Desktop.
Save bmizerany/37672 to your computer and use it in GitHub Desktop.
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
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