Created
January 30, 2009 11:20
-
-
Save peterc/55017 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'vendor/sinatra/lib/sinatra/base' | |
require 'myapp' | |
map "/" do | |
run Myapp | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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