diff options
author | rautenberg <rautenberg@in-silico.ch> | 2015-06-18 16:27:41 +0200 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2015-06-18 16:27:41 +0200 |
commit | 45ddfb793631acb1ef4b10cbb8f6242e0d9dc1eb (patch) | |
tree | e9e70c1e2122296d30e573d5dd2f6ffd65972440 | |
parent | 9dcb32afb52039f193f3dc835c010da43eaed434 (diff) |
hotfix for wrong PATH_INFO in request env /algorithm/api/algorithm.json is /api/algorithm.json
-rw-r--r-- | application.rb | 9 |
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 |