Tests serveur HTTP
This commit is contained in:
@@ -6,11 +6,79 @@ CHttpServer::CHttpServer()
|
||||
mHttpServer = new QHttpServer;
|
||||
mHttpServer->route("/", []()
|
||||
{
|
||||
qDebug("Test");
|
||||
|
||||
return "Ja Mon CB!!!!";
|
||||
|
||||
// return " <!DOCTYPE html>\
|
||||
// <html>\
|
||||
// <head>\
|
||||
// <title>Page Title</title>\
|
||||
// </head>\
|
||||
// <body>\
|
||||
// \
|
||||
// <h1>This is a Heading</h1>\
|
||||
// <p>This is a paragraph.</p>\
|
||||
// \
|
||||
// </body>\
|
||||
// </html>";
|
||||
|
||||
// return " <!DOCTYPE html>\
|
||||
// <html>\
|
||||
// <body>\
|
||||
// \
|
||||
// <h1>My First JavaScript</h1>\
|
||||
// \
|
||||
// <button type=\"button\" \
|
||||
// onclick=\"document.getElementById('demo').innerHTML = Date()\">\
|
||||
// Click me to display Date and Time.</button>\
|
||||
// \
|
||||
// <p id=\"demo\"></p>\
|
||||
// \
|
||||
// </body>\
|
||||
// </html> ";
|
||||
|
||||
|
||||
return "<!DOCTYPE html>\
|
||||
<html>\
|
||||
<body>\
|
||||
\
|
||||
<h2>SVG rect Element</h2>\
|
||||
\
|
||||
<svg width=\"300\" height=\"130\">\
|
||||
<rect width=\"200\" height=\"100\" x=\"10\" y=\"10\" rx=\"20\" ry=\"20\" fill=\"blue\" />\
|
||||
Sorry, your browser does not support inline SVG. \
|
||||
</svg>\
|
||||
\
|
||||
</body>\
|
||||
</html>";
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
mHttpServer->route("/test", []()
|
||||
{
|
||||
|
||||
|
||||
return " <!DOCTYPE html>\
|
||||
<html>\
|
||||
<head>\
|
||||
<title>Page Title</title>\
|
||||
</head>\
|
||||
<body>\
|
||||
\
|
||||
<h1>This is a Heading</h1>\
|
||||
<p>This is a paragraph.</p>\
|
||||
\
|
||||
</body>\
|
||||
</html>";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
const auto port = mHttpServer->listen(QHostAddress::Any,8080);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
CLoraModuleInterface *mChaletLoraModuleInterface;
|
||||
// CAppIconWidget mAppWidget;
|
||||
|
||||
// CHttpServer mHttpServer;
|
||||
CHttpServer mHttpServer;
|
||||
|
||||
CIspindelDevice *mIspindelDevice;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user