lib/eggplant/server.rb in eggplant-0.2.1 vs lib/eggplant/server.rb in eggplant-0.2.2
- old
+ new
@@ -61,11 +61,16 @@
js_compression :none, :no_fallback => true
end
get '/' do
- slim :show
+ index_cache = File.join(settings.presentation_root, 'index.html')
+ if settings.environment == :production && File.exists?(index_cache)
+ send_file index_cache
+ else
+ slim :show
+ end
end
get '/remote' do
slim :remote
end
@@ -88,15 +93,10 @@
get '/download.:format' do |format|
end
def index
- index_cache = File.join(settings.presentation_root, 'index.html')
- if production? && File.exists(index_cache)
- send_file index_cache
- else
- slim :show
- end
+ slim :show
end
def self.configure path, ui=['goto']
set :environment, :production
set :presentation_root, path