diff options
-rw-r--r-- | application.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/application.rb b/application.rb index 3f94032..c95547b 100644 --- a/application.rb +++ b/application.rb @@ -74,6 +74,17 @@ post "/model/:id/?" do return prediction.to_json end +# Get a list of all descriptors +# @param [Header] Accept one of text/plain, application/json +# @return [text/plain, application/json] list of all prediction models +get "/algorithm/descriptor/?" do + case @accept + when "text/plain" + return OpenTox::Algorithm::Descriptor::DESCRIPTORS.collect{|k, v| "#{k}: #{v}\n"} + when "application/json" + return JSON.pretty_generate OpenTox::Algorithm::Descriptor::DESCRIPTORS + end +end =begin post "/model/?" do |