19 lines
436 B
C++
19 lines
436 B
C++
// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "info.h"
|
|
|
|
Handler::Info::Info():
|
|
Handler("info", Request::Method::get)
|
|
{}
|
|
|
|
void Handler::Info::handle(Request& request) {
|
|
Response res(request);
|
|
nlohmann::json body = nlohmann::json::object();
|
|
body["type"] = PROJECT_NAME;
|
|
body["version"] = PROJECT_VERSION;
|
|
|
|
res.setBody(body);
|
|
res.send();
|
|
}
|