Sha256: 573dbe73d08ba4eaa2d88b5c68f394574035cc5ac12624d4934c9054dcf72389
Contents?: true
Size: 579 Bytes
Versions: 11
Compression:
Stored size: 579 Bytes
Contents
require 'webrick' module Awestruct module CLI WEBrick::HTTPUtils::DefaultMimeTypes.store('atom', 'application/atom+xml') WEBrick::HTTPUtils::DefaultMimeTypes.store('appcache', 'text/cache-manifest') class Server attr_reader :server def initialize(path, bind_addr='0.0.0.0', port=4242) @path = path @bind_addr = bind_addr @port = port end def run @server = WEBrick::HTTPServer.new( :DocumentRoot=>@path, :Port=>@port, :BindAddress=>@bind_addr ) @server.start end end end end
Version data entries
11 entries across 11 versions & 2 rubygems