peterc (owner)

Revisions

gist: 55017 Download_button fork
public
Public Clone URL: git://gist.github.com/55017.git
Embed All Files: show embed
README #
1
2
3
4
5
6
7
8
9
10
SINATRA 0.9.x on DREAMHOST (using Rack 0.4) EXPERIMENT
 
File structure is:
 
/home/example.com/config.ru
/home/example.com/myapp.rb
/home/example.com/public
/home/example.com/tmp
/home/example.com/vendor/sinatra (with git clone of edge sinatra)
 
config.ru #
1
2
3
4
5
6
require 'vendor/sinatra/lib/sinatra/base'
require 'myapp'
 
map "/" do
  run Myapp
end
myapp.rb #
1
2
3
4
5
6
7
8
9
class Myapp < Sinatra::Base
  enable :sessions
 
  get '/' do
    session[:x] ||= 0
    session[:x] += 1
    "Hello world! From Sinatra v#{Sinatra::VERSION}, Rack #{Rack.release}, X=#{session[:x]}"
  end
end