Files
DbWebserver-helloworldplugin/helloworldapplication.cpp

25 lines
689 B
C++
Raw Permalink Normal View History

2018-09-17 19:24:38 +02:00
#include "helloworldapplication.h"
#include "webserver.h"
2018-09-22 03:07:20 +02:00
#include "httprequest.h"
#include "httpresponse.h"
#include "httpclientconnection.h"
HelloWorldApplication::HelloWorldApplication(const QJsonObject &config, WebServer &webServer) :
WebApplication(&webServer), m_webServer(webServer)
2018-09-17 19:24:38 +02:00
{
Q_UNUSED(config)
2018-09-17 19:24:38 +02:00
}
void HelloWorldApplication::start()
{
}
2018-09-22 03:07:20 +02:00
void HelloWorldApplication::handleRequest(HttpClientConnection *connection, const HttpRequest &request)
{
HttpResponse response;
response.protocol = request.protocol;
response.statusCode = HttpResponse::StatusCode::OK;
connection->sendResponse(response, "Hello from HelloWorldApplication: " + request.path);
}