Sinatra is a DSL for creating quickly web applications in Ruby.
It’s true you can build many web applications with Ruby on Rails, but sometimes you don’t need too much, there are situations you need a simple application and RoR seems to be too much to solve it.
Install the gem
gem install sinatra
Create a ruby file
# mywebapp.rb require 'sinatra' get '/' do 'Hello Sinatra' end
Sinatra runs on http://localhost:4567 as default.
This defines a simple HTTP method paired with a URL matching pattern. In this case, in the root page it will show a greeting.
get '/' do 'Hello, Sinatra' end
In part two of this post we will work with Views/Templates.