Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

Chapter 4Setting up to Go Live

In the last chapter, we created a Song model
and database table to store the songs in. We also created a web front end
for creating, reading, editing, and deleting them.

In this chapter, we’ll look at the different settings that are
available in Sinatra and learn how to configure an application. We’ll also
address using sessions and discover how they can be employed to create a
simple login system. Later, we’ll cover deploying our application live on
the Internet using the Heroku service.

Configuration

Any configuration options for a Sinatra application can be set in a
configure block:

configure do
#configuration options go here
end

Code inside this block is run only once at startup. You can have as
many configure ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.