#include "cgilet.h"

using namespace cgid;

extern "C" {
extern void * create_cgi();
}

class HelloWorld : public CGILet {
public:
   void process_request(tcp_stream & out, FormData & form_data) {
      cout << "Hello, " << form_data.get_value("name") << "!\n";

      out << "Content-type: text/html\r\n\r\n";

      out << "Hello, " << form_data.get_value("name") << "!\n";
   }
};

void * create_cgi() {
   return (void*)new HelloWorld();
}
