pica/handler/info.cpp

19 lines
451 B
C++
Raw Normal View History

2023-12-30 22:42:11 +00:00
//SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
//SPDX-License-Identifier: GPL-3.0-or-later
2023-12-13 20:33:11 +00:00
#include "info.h"
Handler::Info::Info():
Handler("info", Request::Method::get)
{}
void Handler::Info::handle(Request& request) {
2023-12-22 23:25:20 +00:00
Response& res = request.createResponse();
2023-12-13 20:33:11 +00:00
nlohmann::json body = nlohmann::json::object();
body["type"] = PROJECT_NAME;
body["version"] = PROJECT_VERSION;
res.setBody(body);
res.send();
}