Class: PactBroker::UI::App::RedirectRootToRelationships

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/ui/app.rb

Class Method Summary collapse

Class Method Details

.call(env) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/pact_broker/ui/app.rb', line 38

def self.call env
  # A request for the root path in the browser (not the json index) should
  # redirect to ui/relationships
  if (env['PATH_INFO'].chomp("/") == "")
    [303, {'Location' =>  "#{env['SCRIPT_NAME']}/ui/relationships"},[]]
  else
    [404, {},[]]
  end
end