Module: Blade::Server

Extended by:
Server
Includes:
Component
Included in:
Server
Defined in:
lib/blade/server.rb

Constant Summary collapse

WEBSOCKET_PATH =
"/blade/websocket"

Instance Method Summary collapse

Methods included from Component

included

Instance Method Details

#clientObject



20
21
22
# File 'lib/blade/server.rb', line 20

def client
  @client ||= Faye::Client.new(websocket_url)
end

#startObject



10
11
12
13
14
# File 'lib/blade/server.rb', line 10

def start
  Faye::WebSocket.load_adapter("thin")
  Thin::Logging.silent = true
  Thin::Server.start("localhost", Blade.config.port, app, signals: false)
end

#websocket_url(path = "") ⇒ Object



16
17
18
# File 'lib/blade/server.rb', line 16

def websocket_url(path = "")
  Blade.url(WEBSOCKET_PATH + path)
end