summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--application.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/application.rb b/application.rb
index 9f1f12f..f2f2fab 100644
--- a/application.rb
+++ b/application.rb
@@ -39,5 +39,14 @@ module OpenTox
#to('/feature-selection/recursive-feature-elimination', :full),
to('/descriptor') ].join("\n") + "\n"
end
+
+ # generic route to swagger API file - hotfix because opentox-server route do not work
+ get "/algorithm/api/algorithm.json" do
+ response['Content-Type'] = "application/json"
+ api_file = File.join("api", "algorithm.json")
+ bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/algorithm/api") unless File.exists?(api_file)
+ File.read(api_file)
+ end
+
end
end