Sha256: f69d9ffc366773629f0bfc44d56f56d67b79cf5b59fcd274dbbaf5ecd55d8f63
Contents?: true
Size: 1.03 KB
Versions: 2
Compression:
Stored size: 1.03 KB
Contents
module Simple end module Simple::Httpd end require "simple/httpd/version" require "simple/httpd/app" require "simple/httpd/base_controller" module Simple::Httpd extend self def build_rack(base_controller, logger:) App.new(base_controller, logger: logger) end def listen!(app, environment:, port:) expect! port => 80..60_000 logger = app.logger logger.info "Starting httpd server on http://0.0.0.0:#{port}/" app = Rack::Lint.new(app) if environment != "production" # re/AccessLog: the AccessLog setting points WEBrick's access logging to the # NullLogger object. # # Instead we'll use a combination of Rack::CommonLogger (see Simple::Httpd.app), # and sinatra's logger (see Simple::Httpd::BaseController). Rack::Server.start app: app, Port: port, environment: environment, Logger: logger, AccessLog: [[NullLogger, ""]] end module NullLogger # :nodoc: extend self def <<(msg); end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
simple-httpd-0.0.4 | lib/simple/httpd.rb |
simple-httpd-0.0.2 | lib/simple/httpd.rb |