Module: Hippo::API::Cable

Defined in:
lib/hippo/api/cable.rb

Defined Under Namespace

Classes: Connection

Class Method Summary collapse

Class Method Details

.configureObject


35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/hippo/api/cable.rb', line 35

def self.configure
    require_relative './updates'
    @@config = ActionCable::Server::Configuration.new
    config.logger = Hippo.logger
    config.cable = Hippo.config.cable
    config.connection_class = -> { Connection }
    config.allowed_request_origins = -> (host) {
        host
    }
    ActionCable::Server::Base.config = config
    @@server = ActionCable.server

    Updates.relay!
end

.handle_request(request) ⇒ Object


9
10
11
# File 'lib/hippo/api/cable.rb', line 9

def self.handle_request(request)
    @@server.call(request.env)
end