diff options
author | Christoph Helma <helma@in-silico.de> | 2010-01-07 17:54:56 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2010-01-07 17:54:56 +0100 |
commit | d94decfd1d93b13aad733e5adaad09d676eb691d (patch) | |
tree | 42ce56926bd5c47e95a50ac4fd86d28587d83a3e /config.ru |
Initial task service, not API compliant
Diffstat (limited to 'config.ru')
-rw-r--r-- | config.ru | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..63dd2ce --- /dev/null +++ b/config.ru @@ -0,0 +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/#{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 + |