Sha256: 687902862678a6ee505a0731ed9afac88f1542b789d53526ed659b8b6f311f9e

Contents?: true

Size: 566 Bytes

Versions: 6

Compression:

Stored size: 566 Bytes

Contents

require_relative 'responder'

module Nephos
  class Server

    SERVER = lambda {|env| return Router.execute(env)}

    attr_accessor :port, :host

    # @param port [Integer] port to listen
    def initialize port="8080", host="0.0.0.0"
      @port = Integer(port)
      @host = host.to_s
    end

    # start the Rack server
    def start
      Rack::Server.start :app => SERVER, :Port => @port, :Host => @host
    end

    # start the Rack server on a instance of Nephos::Server
    def self.start port, host
      Server.new(port, host).start
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nephos-server-0.5.4 lib/nephos-server/server/main.rb
nephos-server-0.5.2 lib/nephos-server/server/main.rb
nephos-server-0.5.0 lib/nephos-server/server/main.rb
nephos-server-0.4.8 lib/nephos-server/server/main.rb
nephos-server-0.4.7 lib/nephos-server/server/main.rb
nephos-server-0.4.6 lib/nephos-server/server/main.rb