HTTPServer/__index.h

34 lines
1.3 KiB
C++

#ifndef ____index_h__
#define ____index_h__
#include "HTTPPage.h"
#include "HTTPRequest.h"
namespace http {
class __index : public HTTPPage {
int processCommand(std::string request, core::TCPSession *session, HTTPSession *httpSession, HTTPRequest &httpRequest, std::stringstream &data) override {
data << "<html>" << std::endl;
data << " <head>" << std::endl;
data << " <link rel=\"icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />" << std::endl;
data << " <link type=\"text/css\" rel=\"stylesheet\" href=\"/style\" />" << std::endl;
data << " <script src=\"/script\"></script>" << std::endl;
data << " </head>" << std::endl;
data << "<body ondragstart=\"return false;\" " << std::endl;
data << " ondrop=\"return false;\" " << std::endl;
data << " onLoad=\"getPage('/welcome','main');\">" << std::endl;
data << " <div id=\"main\">If you see this then something is wrong.</div>" << std::endl;
data << " </body>" << std::endl;
data << "</html>" << std::endl;
httpRequest.response.addHeader("Content-Type", "text/html");
return true;
}
};
}
#endif