14198: Add paging on container list, check for valid cluster id
[arvados.git] / services / api / app / controllers / static_controller.rb
index 168ec43ce63c64d799a62e4712a34357d983314c..f0992c18314ac22bc60034855a204ab3aedce796 100644 (file)
@@ -1,11 +1,31 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class StaticController < ApplicationController
+  respond_to :json, :html
 
-  skip_before_filter :uncamelcase_params_hash_keys
   skip_before_filter :find_object_by_uuid
-  skip_before_filter :login_required, :only => :home
+  skip_before_filter :render_404_if_no_object
+  skip_before_filter :require_auth_scope, only: [:home, :empty, :login_failure]
 
   def home
-    render 'intro'
+    respond_to do |f|
+      f.html do
+        if Rails.configuration.workbench_address
+          redirect_to Rails.configuration.workbench_address
+        else
+          render_not_found "Oops, this is an API endpoint. You probably want to point your browser to an Arvados Workbench site instead."
+        end
+      end
+      f.json do
+        render_not_found "Path not found."
+      end
+    end
+  end
+
+  def empty
+    render text: ""
   end
 
 end