From f801199e5d17c95f6ae3da7917ff5ddcdf63b86c Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 6 Oct 2009 09:52:59 +0200 Subject: Passes tests in opentox-test --- config.ru | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'config.ru') diff --git a/config.ru b/config.ru index 0ca30c5..63dd2ce 100644 --- a/config.ru +++ b/config.ru @@ -1,10 +1,23 @@ require 'rubygems' require 'sinatra' require 'application.rb' +require 'rack' +require 'rack/contrib' FileUtils.mkdir_p 'log' unless File.exists?('log') -log = File.new("log/sinatra.log", "a") +log = File.new("log/#{ENV["RACK_ENV"]}.log", "a") $stdout.reopen(log) $stderr.reopen(log) + +if ENV['RACK_ENV'] == 'production' + use Rack::MailExceptions do |mail| + mail.to 'helma@in-silico.ch' + mail.subject '[ERROR] %s' + end +elsif ENV['RACK_ENV'] == 'development' + use Rack::Reloader + use Rack::ShowExceptions +end run Sinatra::Application + -- cgit v1.2.3