Sha256: af68a92e665addc3c7847bb7178de318a52737f12cd3f433a11bac99abf9fbc8
Contents?: true
Size: 679 Bytes
Versions: 10
Compression:
Stored size: 679 Bytes
Contents
require 'mongrel' module Awestruct module Commands #Mongrel::DirHandler::MIME_TYPES['.atom'] = 'text/plain' Mongrel::DirHandler::MIME_TYPES['.atom'] = 'application/atom+xml' 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 = Mongrel::HttpServer.new( @bind_addr, @port ) handler = Mongrel::DirHandler.new( @path ) @server.register("/", handler ) $stderr.puts "Launching server on http://#{@bind_addr}:#{@port}/" @server.run.join end end end end
Version data entries
10 entries across 10 versions & 1 rubygems