1require "webrick" 2 3class HelloServlet < WEBrick::HTTPServlet::AbstractServlet 4 def do_GET(req, res) 5 res["content-type"] = "text/plain" 6 res.body = "Hello, world.\n" 7 end 8end 9