# -*- coding: iso-8859-1 -*-
require 'wreq'

my_proc = lambda do |req,resp|
  resp['Content-Type'] = "text/html"
  resp.body = %{
  #{MyServer::DOCTYPE}
  <html>
  <head>
    #{MyServer::META}
    <title>Form</title>
  </head>
  <body>
  Query parameters: #{l = "" ; req.query.each {|k, v| l << "<br>#{k}: #{v}"} ; l}
 
 <p><a href="/">Mégegyszer?</a></body></html>}
end

s = MyServer.new(:Port => 9090)
s.publish("/doit",my_proc)
s.publish_file("/","form3.html")
s.start
