Class: PassiveQueue::Web

Inherits:
Object
  • Object
show all
Defined in:
lib/passive_queue/web.rb

Overview

Rack web application providing a dashboard interface for PassiveQueue

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Array

Rack call method that routes requests to appropriate handlers

Parameters:

  • env (Hash)

    Rack environment hash

Returns:

  • (Array)

    Rack response triplet [status, headers, body]



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/passive_queue/web.rb', line 14

def call(env)
  request = Rack::Request.new(env)
  
  case request.path_info
  when '/'
    dashboard_response
  when '/api/stats'
    api_stats_response
  when '/api/zen'
    api_zen_response
  when '/favicon.ico'
    favicon_response
  when '/logo.svg'
    logo_response
  when '/logo-dark.svg'
    logo_dark_response
  else
    not_found_response
  end
end