Skip to content

Commit

Permalink
index.erb view
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Aug 22, 2009
1 parent dbd4ffb commit 7960bab
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions hurl.rb
@@ -1,13 +1,25 @@
require 'sinatra/base'
require 'redis'

begin
require 'redis'
rescue LoadError
nil
end

class Hurl < Sinatra::Base
dir = File.dirname(File.expand_path(__FILE__))

set :views, "#{dir}/views"
set :static, true

def initialize(*args)
super
@redis = Redis.new(:host => '127.0.0.1', :port => 6379)
if defined? Redis
@redis = Redis.new(:host => '127.0.0.1', :port => 6379)
end
end

get '/' do
render :index
erb :index
end
end

0 comments on commit 7960bab

Please sign in to comment.