diff options
author | rautenberg <rautenberg@in-silico.ch> | 2016-11-18 13:02:14 +0100 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2016-11-18 13:02:14 +0100 |
commit | c2fcfe79a10b7bd022c306a07f354a8839144614 (patch) | |
tree | c1406ddd444da6840b987fd17fe897753690e3fb | |
parent | e8110b727eb896c5094c5ea255a88c44a8e1f5f0 (diff) |
set LAZAR_ENV to RACK_ENV
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/lazar-rest.rb | 14 |
2 files changed, 16 insertions, 3 deletions
@@ -1,3 +1,6 @@ +2016-11-18 +* adapt code to lazar 1.0.0 +* set LAZAR_ENV to RACK_ENV from unicorn 2016-10-20 * License to GPL3 2016-09-14 @@ -6,4 +9,4 @@ * new code structure * addaption to new lazar and nano-lazar 2015-10 -* initial version
\ No newline at end of file +* initial version diff --git a/lib/lazar-rest.rb b/lib/lazar-rest.rb index 2de3998..77483f2 100644 --- a/lib/lazar-rest.rb +++ b/lib/lazar-rest.rb @@ -1,6 +1,16 @@ require "sinatra" -require "../lazar/lib/lazar.rb" -require "../qsar-report/lib/qsar-report.rb" + +# Environment setup from unicorn -E param +ENV["LAZAR_ENV"] = ENV["RACK_ENV"] + +if ENV["LAZAR_ENV"] == "development" + require "../lazar/lib/lazar.rb" + require "../qsar-report/lib/qsar-report.rb" +else + require "lazar" + require "qsar-report" +end + include OpenTox require 'rack/cors' |