Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b43ec9798b
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (21 sloc) 0.669 kb

Configuration

Use Sinatra's "set" option

Configure blocks are not executed in the event context, and don't have access to the same instance variables. To store a piece of information that you want to access in your routes, use set.

configure :development do
  set :dbname, 'devdb'
end

configure :production do
  set :dbname, 'productiondb'
end

...

get '/whatdb' do
  'We are using the database named ' + options.dbname
end

External config file via the configure block

Application module / config area

Jump to Line
Something went wrong with that request. Please try again.