Skip to content

Instantly share code, notes, and snippets.

@tbuehlmann
Created December 6, 2010 22:16
Show Gist options
  • Save tbuehlmann/731085 to your computer and use it in GitHub Desktop.
Save tbuehlmann/731085 to your computer and use it in GitHub Desktop.
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'foo'
run Foo
require 'sinatra/base'
require 'redis'
class Foo < Sinatra::Base
configure do
set :redis, Redis.new
end
get '/' do
settings.redis.incr 'counter'
'foo'
end
get '/visits' do
"#{settings.redis.get 'counter'} visits"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment