From 6a2c3f2100d030c30b7d8ac8c95dcece7edb040c Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 8 Sep 2009 16:04:23 +0200 Subject: api separated into individual components, adapted for new webservice versions --- lib/templates/config.ru | 23 +++++++++++++++++++++++ lib/templates/config.yaml | 12 +++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 lib/templates/config.ru (limited to 'lib/templates') diff --git a/lib/templates/config.ru b/lib/templates/config.ru new file mode 100644 index 0000000..63dd2ce --- /dev/null +++ b/lib/templates/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 + diff --git a/lib/templates/config.yaml b/lib/templates/config.yaml index 768fa01..14326fe 100644 --- a/lib/templates/config.yaml +++ b/lib/templates/config.yaml @@ -1,8 +1,10 @@ :base_dir: /home/ch/webservices :webserver: thin :services: - - opentox-feature - - opentox-compound - - opentox-dataset - - opentox-fminer - - opentox-lazar +# make sure to provide a full uri (including training slash) + opentox-feature: "http://localhost:5000/" + opentox-compound: "http://localhost:5001/" + opentox-dataset: "http://localhost:5002/" + opentox-fminer: "http://localhost:5003/" + opentox-similarity: "http://localhost:5004/" + opentox-lazar: "http://localhost:5005/" -- cgit v1.2.3