Sinatra

edit by double-clicking content
edit this page

Home

Sinatra is the easiest way to create a Fast, RESTful, web-application in Ruby with few dependencies, setup, and LOC.

Installation

sudo gem install sinatra

Your first Sinatra app


            require "rubygems" 
            require "sinatra" 
            
            get '/' do
             "Hello World" 
            end

Run your app with $ ruby myapp.rb and point your browser at http://localhost:4567

Bleeding Edge

  1. cd where/you/keep/your/projects
  2. git clone git://github.com/bmizerany/sinatra.git
  3. cd your_project
  4. ln -s ../sinatra

at the top of your sinatra.rb file

$:.unshift File.dirname(__FILE__) + '/sinatra/lib'
            require 'sinatra'
            
            get '/about' do
              "All good in the hood" 
            end

More stuff

Killer resources!

Sources
  • IRC: irc.freenode.net #sinatra