Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created April 13, 2009 21:31
Show Gist options
  • Save vangberg/94742 to your computer and use it in GitHub Desktop.
Save vangberg/94742 to your computer and use it in GitHub Desktop.
# Classical top-style apps and Sinatra::Default has a bunch of useful
# default settings not found in Sinatra::Base:
#
# - Exceptions are mapped to the error handler of your Sinatra app
# instead of propagating to Rack
#
# - The Rack::MethodOverride middleware is enabled, allowing the
# '_method=PUT' hack
#
# - Static files are served from the public directory
#
# - Logging is enabled
#
# .. and then some. Take a look at the source yourself:
class Default < Base
set :raise_errors, Proc.new { test? }
set :dump_errors, true
set :sessions, false
set :logging, Proc.new { ! test? }
set :methodoverride, true
set :static, true
set :run, Proc.new { ! test? }
..
end
# Refer to http://www.sinatrarb.com/configuration.html for documenation
# for the different options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment