Skip to content

Instantly share code, notes, and snippets.

@timmyc
Created August 22, 2010 00:57
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timmyc/543111 to your computer and use it in GitHub Desktop.
Save timmyc/543111 to your computer and use it in GitHub Desktop.
require "sinatra"
require "digest/sha1"
require 'rack-flash'
require 'mongoid'
require "sinatra-authentication"
use Rack::Session::Cookie, :secret => 'mongoid and sinatra does the body good'
use Rack::Flash
Mongoid.configure do |config|
name = 'skittles'
host = 'localhost'
config.master = Mongo::Connection.new.db(name)
end
get '/' do
'hello world'
end
get '/private' do
login_required
'My Super Top-Secret Page'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment