Guest User

Untitled

a guest
Feb 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. # requiring 'sinatra' brings in 'sinatra/base' and 'sinatra/main', which
  2. # triggers the top-level hackery. Also required is 'sinatra/compat', which
  3. # includes support for things I propose we deprecate.
  4. require 'sinatra'
  5.  
  6. enable :sessions # Sinatra::Application.enable :sessions
  7. set :foo, 'bar' # Sinatra::Application.set :foo, 'bar'
  8.  
  9. configure :production do # Sinatra::Application.configure :production
  10. ...
  11. end
  12.  
  13. helpers do # class Sinatra::Application
  14. def blink(text)
  15. "<blink>#{text}</blink>"
  16. end
  17. end
  18.  
  19. get '/foo/:who' do # Sinatra::Application.get '/foo/:who'
  20. ...
  21. end
  22.  
  23. # Sinatra::Application is the "default application"; all top-level calls are
  24. # delegated there.
Add Comment
Please, Sign In to add comment