lib/genevalidatorapp/routes.rb in genevalidatorapp-1.5.2 vs lib/genevalidatorapp/routes.rb in genevalidatorapp-1.5.3

- old
+ new

@@ -49,11 +49,18 @@ end post '/' do cross_origin # Required for the API to work... RunGeneValidator.init(request.url, params) - @json_results = RunGeneValidator.run - slim :results, layout: false + @gv_results = RunGeneValidator.run + @json_results = @gv_results[:parsed_json] + if @params[:results_url] + @gv_results[:results_url] + elsif @params[:json_url] + @gv_results[:json_url] + else + slim :results, layout: false + end end # This error block will only ever be hit if the user gives us a funny # sequence or incorrect advanced parameter. Well, we could hit this block # if someone is playing around with our HTTP API too.