Tests serveur HTTP

This commit is contained in:
2024-12-27 12:59:20 -05:00
parent 918d2d8fdb
commit 3fb8de2ea7
4 changed files with 80 additions and 7 deletions
+70 -2
View File
@@ -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);
+1 -1
View File
@@ -47,7 +47,7 @@ public:
CLoraModuleInterface *mChaletLoraModuleInterface;
// CAppIconWidget mAppWidget;
// CHttpServer mHttpServer;
CHttpServer mHttpServer;
CIspindelDevice *mIspindelDevice;