diff options
-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' |