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 "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();
|
|
|
|
}
|