Sinatra if you need lighter

Sinatra (ruby) was quite popular gem few years ago, however after having fun chat with Eric Silverberg last weekend in NYC @scruffapp ;)) hey mate! ;)) where they have Sinatra.rb and their made me reviewing this technology trying to figure out what are the major benefits versus other popular thing like Rails (or Ruby on Rails).

Well, both are having their niches and are good fit in certain cases. I am now fan of both!

  • Sinatra is the way easier and lighter than RoR!
  • http queries are the very first thing you start seeing when Sinatring your App

Quick example of Hello World:

$ gem install sinatra
$ mkdir sinatra
$ cd sinatra
$ touch sinatra.rb

And having the following:

# sinatra.rb

require 'sinatra'
get '/' do
'Hello world!'

Almost there:

$ ruby sinatra.rb
== Sinatra (v1.4.7) has taken the stage on 4567 for development with backup from Thin
Thin web server (v1.7.0 codename Dunder Mifflin)
Maximum connections set to 1024
Listening on localhost:4567, CTRL+C to stop
::1 - - [13/Aug/2016:10:11:24 +0300] "GET / HTTP/1.1" 200 12 0.0094

Ready to serve and this is just few minutes! I am sure this is good for those who need lightweight server side!

In short, this is about:

Start discussion:
Related articles:
One of the evening I spend on parsing xml content with 1000+ pages. grep, awk, sed were awesome, but the head were getting bigger with massive number of regex's, so nokogiri made it easier. ... more
about 3 years#nokogiri #ruby
In CloudBerry Lab we help people to move data offsite to the cloud either with backup or file management solution. Sometimes I need sample files, a lot of sample files. ... more
over 2 years#cloudberrylab #ruby