pica/handler/env.cpp

18 lines
414 B
C++
Raw Normal View History

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