Sha256: 3fa5c7aa19dc986f48e473f4912df43cb957cbfc7123840d815beb6ecaf47d1e

Contents?: true

Size: 465 Bytes

Versions: 4

Compression:

Stored size: 465 Bytes

Contents

module Oxidized
  module API
    class Web
      attr_reader :thread
      def initialize nodes, listen
        require 'oxidized/web/webapp'
        addr, port = listen.to_s.split ':'
        port, addr = addr, nil if not port
        WebApp.set :server, %w(puma)
        WebApp.set :bind, addr if addr
        WebApp.set :port, port
        WebApp.set :nodes, nodes
      end
      def run
        @thread = Thread.new { WebApp.run! }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
oxidized-web-0.1.0 lib/oxidized/web.rb
oxidized-web-0.0.3 lib/oxidized/web.rb
oxidized-web-0.0.2 lib/oxidized/web.rb
oxidized-web-0.0.1 lib/oxidized/web.rb