Class: CSGOLytics::HTTPServer

Inherits:
Object
  • Object
show all
Defined in:
lib/csgolytics/http_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(backend, port) ⇒ HTTPServer

Returns a new instance of HTTPServer.



28
29
30
31
# File 'lib/csgolytics/http_server.rb', line 28

def initialize(backend, port)
  @http = WEBrick::HTTPServer.new(:Port => port)
  @http.mount "/", CSGOLytics::HTTPServlet, backend
end

Instance Method Details

#listenObject



33
34
35
# File 'lib/csgolytics/http_server.rb', line 33

def listen
  @http.start
end

#shutdownObject



37
38
39
# File 'lib/csgolytics/http_server.rb', line 37

def shutdown
  @http.shutdown
end