1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/examples/simpletest.rb
zedshaw 6a5116197a First work at making a functional response class.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@9 19e92222-5c0b-0410-8929-a290d50e31e9
2006-01-28 19:34:12 +00:00

16 lines
342 B
Ruby

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