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!'
end

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:
#sinatra
#ruby

Start discussion:
Related articles:
95 the nokogiri version of scraping data preview
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
over 1 year#nokogiri #ruby
114 how to download random pictures preview
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