1234567891011121314151617181920212223242526272829303132 |
- #include "starthandler.h"
- #include <QFile>
- starthandler::starthandler()
- {
- }
- bool starthandler::handleGet(CivetServer *server, mg_connection *conn)
- {
- (void )server;
- mg_printf(conn,
- "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nConnection: "
- "close\r\n\r\n");
- mg_printf(conn, "<!DOCTYPE html>\n");
- mg_printf(conn, "<html>\n<head>\n");
- mg_printf(conn, "<meta charset=\"UTF-8\">\n");
- mg_printf(conn, "<title>ADC IV RemoteCtrl UI</title>\n");
- QFile xFile;
- xFile.setFileName("./frontend/index.html");
- if(xFile.open(QIODevice::ReadOnly))
- {
- QByteArray ba = xFile.readAll();
- mg_printf(conn,"%s",ba.data());
- }
- return true;
- }
|