Sha256: 0785e26cdd3a796b5f2c1a7edc453fd9b6d9a41dc488a8cf45ad5c90d7b6032d

Contents?: true

Size: 554 Bytes

Versions: 2

Compression:

Stored size: 554 Bytes

Contents

require_relative 'basic_errors'
require_relative 'responder'
require_relative '../routing/execute'

module Nephos
  class Server

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

    attr_accessor :port

    # @params port [Integer] port to listen
    def initialize port
      @port = Integer(port)
    end

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

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

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nephos-server-0.1.7 lib/nephos-server/server/main.rb
nephos-server-0.1.6 lib/nephos-server/server/main.rb