O'Reilly logo

Learning Sinatra by Manoj Sehrawat, Sudeep Agarwal

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.

Start Free Trial

No credit card required

Starting the application

Earlier, we used to write the following on our command line to start our application:

ruby <filename>

For our current project, the main file is app.rb. As we also have a rackup file, we should start our application through that file:

ruby config.ru

This will execute config.ru and start the server. We will see something like this on our command line. This says that the Sinatra server is ready and listening for requests on port 4567 for the development deployment:

Starting the application

However, we have not defined our routes yet. So, all requests sent to this server would fail. We can define a few routes to check whether our application is running or ...

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

Start Free Trial

No credit card required