Sha256: 31a8804b4d10ad58a8e852467cca4d82f5539356fef89016782f6443a6dd59c3

Contents?: true

Size: 342 Bytes

Versions: 2

Compression:

Stored size: 342 Bytes

Contents

require 'mongrel'
require 'yaml'

class SimpleHandler < Mongrel::HttpHandler
    def process(request, response)
      response.start do |head,out|
        head["Content-Type"] = "text/plain"
        out.write("hello!\n")
      end
    end
end

h = Mongrel::HttpServer.new("0.0.0.0", "3000")
h.register("/test", SimpleHandler.new)
h.run.join

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongrel-0.2.1 examples/simpletest.rb
mongrel-0.2.0 examples/simpletest.rb