absolute_redirects
If disabled, Sinatra will allow relative redirects, however, Sinatra will no longer conform with RFC 2616 (HTTP 1.1), which only allows absolute redirects.
Enable if your app is running behind a reverse proxy that has not been set up properly. Note that the url
helper will still produce absolute URLs, unless you pass in false
as the second parameter.
Disabled by default.
add_charsets
mime types the content_type
helper will automatically add the charset info to.
You should add to it rather than overriding this option:
settings.add_charsets << "application/foobar"
app_file
Path to the main application file, used to detect project root, views and public folder and inline templates.
bind
IP address to bind to (default: 0.0.0.0 or localhost if your environment
is set to
development
). Only used for built-in server.
default_encoding
encoding to assume if unknown (defaults to "utf-8").
dump_errors
display errors in the log.
environment
current environment, defaults to ENV['RACK_ENV']
,
or development
if not available.
logging
use the logger.
lock
Places a lock around every request, only running processing on request per Ruby process concurrently.
Enabled if your app is not thread-safe. Disabled per default.
method_override
use _method magic
to allow put/delete forms in browsers that don't support it.
port
Port to listen on. Only used for built-in server.
prefixed_redirects
Whether or not to insert request.script_name
into redirects if no absolute path is given. That way redirect '/foo' would behave like redirect to('/foo'). Disabled per default.
protection
Whether or not to enable web attack protections. See protection section above.
public_dir
Alias for public_folder
. See below.
public_folder
Path to the folder public files are served from. Only used if static file serving is enabled (see static setting below). Inferred from app_file
setting if not set.
reload_templates
Whether or not to reload templates between requests. Enabled in development mode.
root
Path to project root folder. Inferred from app_file
setting if not set.
raise_errors
raise exceptions (will stop application). Enabled by default when environment is set to "test", disabled otherwise.
run
if enabled, Sinatra will handle starting the web server, do not enable if using rackup or other means.
running
is the built-in server running now? do not change this setting!
server
Server or list of servers to use for built-in server. order indicates priority, default depends on Ruby implementation.
sessions
Enable cookie-based sessions support using Rack::Session::Cookie. See 'Using Sessions' section for more information.
show_exceptions
Show a stack trace in the browser when an exception happens. Enabled by default when environment is set to "development", disabled otherwise.
Can also be set to :after_handler
to trigger app-specified error handling before showing a stack trace in the browser.
static
Whether Sinatra should handle serving static files.
Disable when using a server able to do this on its own.
Disabling will boost performance.
Enabled per default in classic style, disabled for modular apps.
static_cache_control
When Sinatra is serving static files, set this to add Cache-Control headers to the responses.
Uses the cache_control
helper. Disabled by default.
Use an explicit array when setting multiple values:
set :static_cache_control, [:public, :max_age => 300]
threaded
If set to true, will tell Thin to use EventMachine.defer for processing the request.
views
Path to the views folder. Inferred from app_file
setting if not set.
x_cascade
Whether or not to set the X-Cascade header if no route matches. Defaults to true.
Casiano Rodriguez León 2015-01-07