summaryrefslogtreecommitdiff
path: root/src/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/httpserver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/protocols/httpserver.cpp b/src/protocols/httpserver.cpp
index 164ce54..f1b562e 100644
--- a/src/protocols/httpserver.cpp
+++ b/src/protocols/httpserver.cpp
@@ -30,10 +30,12 @@ HttpServer::HttpServer(std::shared_ptr<ICamera> camera,
, INIT_FIELD(port)
, m_server{std::make_shared<QHttpServer>()}
{
+ // TODO: move these vars outside
const auto apiPrefix = QStringLiteral("/v1");
const auto pixelsPath = apiPrefix + "/pixels";
qDebug().noquote() << Q_FUNC_INFO << ": pixelsPath: " << pixelsPath;
+ // TODO: get rid of lamdas, there should be a better way
m_server->route(pixelsPath, [this]() { return GET_pixels(); });
m_server->route(apiPrefix + QStringLiteral("/sensor/params"),
QHttpServerRequest::Method::Get,
@@ -55,7 +57,7 @@ HttpServer::HttpServer(std::shared_ptr<ICamera> camera,
QHttpServerResponse HttpServer::GET_image()
{
- static Image img;
+ Image img;
if (!m_camera->getImage(&img)) {
qCritical() << "cannot get image";