Skip to content

Instantly share code, notes, and snippets.

@peterc
Created January 30, 2009 11:20
Show Gist options
  • Save peterc/55017 to your computer and use it in GitHub Desktop.
Save peterc/55017 to your computer and use it in GitHub Desktop.
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)
require 'vendor/sinatra/lib/sinatra/base'
require 'myapp'
map "/" do
run Myapp
end
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment