3781: Merge branch '3781-browser-friendly-servers' into 3781-browser-upload
[arvados.git] / services / api / app / controllers / static_controller.rb
1 class StaticController < ApplicationController
2   respond_to :json, :html
3
4   skip_before_filter :find_object_by_uuid
5   skip_before_filter :render_404_if_no_object
6   skip_before_filter :require_auth_scope, only: [:home, :empty, :login_failure]
7
8   def home
9     respond_to do |f|
10       f.html do
11         if Rails.configuration.workbench_address
12           redirect_to Rails.configuration.workbench_address
13         else
14           render_not_found "Oops, this is an API endpoint. You probably want to point your browser to an Arvados Workbench site instead."
15         end
16       end
17       f.json do
18         render_not_found "Path not found."
19       end
20     end
21   end
22
23   def empty
24     render text: "-"
25   end
26
27 end