class Oxidized::API::Web
Attributes
thread[R]
Public Class Methods
new(nodes, listen)
click to toggle source
# File lib/oxidized/web.rb, line 9 def initialize nodes, listen require 'oxidized/web/webapp' listen, uri = listen.split '/' addr, _, port = listen.rpartition ':' port, addr = addr, nil if not port uri = '/' + uri.to_s @opts = { Host: addr, Port: port, } WebApp.set :nodes, nodes @app = Rack::Builder.new do map uri do run WebApp end end end
Public Instance Methods
run()
click to toggle source
# File lib/oxidized/web.rb, line 27 def run @thread = Thread.new do Rack::Handler::Puma.run @app, @opts exit! end end