#ifndef ____index_h__
#define ____index_h__

#include "HTTPPage.h"
#include "IMFHeader.h"

namespace http {

   class __index : public HTTPPage {

      int page(HTTPParameters &p) override {

         printf("path: %s", p.httpRequest.uriValues["path"].str().c_str());

         p.data << "<html>"
                   " <head>"
                   "  <link rel=\"icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />"
                   "  <link type=\"text/css\" rel=\"stylesheet\" href=\"/style\" />"
                   "  <script src=\"/script\"></script>"
                   " </head>"
                   " <body ondragstart=\"return false;\" "
                   "      ondrop=\"return false;\" "
                   "      onLoad=\"getView('/welcome','main');\">"
                   "  <div id=\"main\">If you see this then something is wrong.</div>"
                   " </body>"
                   "</html>";

         p.httpRequest.response.addHeader(coreutils::IMFHeader("Content-Type", "text/html"));
         return true;
      }
   };
}

#endif
