Skip to content
Browse files

correctly add rack-cache - to app.rb

  • Loading branch information...
1 parent 868a519 commit 544b456e97fcd81ccffa0ddaca2f081475481a66 @siuying committed Apr 27, 2012
Showing with 8 additions and 10 deletions.
  1. +0 −10 config.ru
  2. +8 −0 lib/seinfeld/app.rb
View
10 config.ru
@@ -1,15 +1,5 @@
require ::File.dirname(__FILE__) + "/lib/seinfeld.rb"
require 'rack/rewrite'
-use Rack::Rewrite do
- r301 '/', '/~siuying'
-
- if ENV['RAILS_ENV'] == 'production'
- r301 %r{.*}, 'http://opensource.reality.hk$&', :if => Proc.new {|rack_env|
- rack_env['SERVER_NAME'] != 'opensource.reality.hk'
- }
- end
-end
-
Seinfeld::App.set :environment, ENV['RACK_ENV'] || ENV['RAILS_ENV'] || :production
run Seinfeld::App
View
8 lib/seinfeld/app.rb
@@ -14,6 +14,14 @@ module Views
class App < Sinatra::Base
register Mustache::Sinatra
use Rack::Cache
+ use Rack::Rewrite do
+ if ENV['RACK_ENV'] == 'production'
+ r301 %r{.*}, 'http://opensource.reality.hk$&', :if => Proc.new {|rack_env|
+ rack_env['SERVER_NAME'] != 'opensource.reality.hk'
+ }
+ end
+ r301 '/', '/~siuying'
+ end
error do
e = request.env['sinatra.error']

0 comments on commit 544b456

Please sign in to comment.
Something went wrong with that request. Please try again.