summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2017-06-09 06:58:24 +0000
committergebele <gebele@in-silico.ch>2017-06-09 06:58:24 +0000
commitd2b22c6cb5872c2e88961a0373e01c3a510fa08b (patch)
tree2a1560fb941569304292be74dff28c8157c8568b
parent02a48a009f1a241102ce760feb9376ae04f81f7f (diff)
fixed for eNM brancheNM
-rw-r--r--lib/model.rb2
-rw-r--r--lib/report.rb4
-rw-r--r--lib/swagger.rb8
3 files changed, 9 insertions, 5 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 22094e9..a20850b 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -3,7 +3,7 @@
# @param [Header] Accept one of text/uri-list,
# @return [text/uri-list] list of all prediction models
get "/model/?" do
- models = Model::Validation.all
+ models = Model::Prediction.all
case @accept
when "text/uri-list"
uri_list = models.collect{|model| uri("/model/#{model.model_id}")}
diff --git a/lib/report.rb b/lib/report.rb
index 52cced1..71c2045 100644
--- a/lib/report.rb
+++ b/lib/report.rb
@@ -2,7 +2,7 @@
# @param [Header] Accept one of text/uri-list,
# @return [text/uri-list] list of all prediction models
get "/report/?" do
- models = Model::Validation.all
+ models = Model::Prediction.all
case @accept
when "text/uri-list"
uri_list = models.collect{|model| uri("/report/#{model.model_id}")}
@@ -26,7 +26,7 @@ end
get "/report/:id/?" do
model = Model::Lazar.find params[:id]
resource_not_found_error "Model with id: #{params[:id]} not found." unless model
- prediction_model = Model::Validation.find_by :model_id => params[:id]
+ prediction_model = Model::Prediction.find_by :model_id => params[:id]
validation_template = File.join(File.dirname(__FILE__),"../views/model_details.haml")
if File.directory?("#{File.dirname(__FILE__)}/../../lazar")
diff --git a/lib/swagger.rb b/lib/swagger.rb
index 916439e..c7b84aa 100644
--- a/lib/swagger.rb
+++ b/lib/swagger.rb
@@ -1,8 +1,12 @@
set :public_folder, File.join("/home/ist/swagger-ui/dist/")
# route to swagger API file
-get "/" do
+get "/?" do
response['Content-Type'] = "text/html"
index_file = File.join("/home/ist/swagger-ui/dist/index.html")
- #bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/#{SERVICE}/api") unless File.exists?(index_file)
+ bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/#{SERVICE}/api") unless File.exists?(index_file)
File.read(index_file)
end
+
+get "/swagger/?" do
+ redirect to("/")
+end