mirror of https://github.com/Alia5/GlosSI
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
#pragma once
|
|
#include "HttpServer.h"
|
|
#include "../common/Settings.h"
|
|
#include "../common/steam_util.h"
|
|
|
|
namespace CHTE {
|
|
|
|
inline void addEndpoints()
|
|
{
|
|
|
|
HttpServer::AddEndpoint(
|
|
{"/running",
|
|
HttpServer::Method::GET,
|
|
[](const httplib::Request& req, httplib::Response& res) {
|
|
// TODO: extend this when "passive" running of global mods is implemented
|
|
res.set_content(nlohmann::json{{"state", nlohmann::json{{"running", true}}}}.dump(), "text/json");
|
|
}});
|
|
|
|
HttpServer::AddEndpoint(
|
|
{"/settings",
|
|
HttpServer::Method::GET,
|
|
[](const httplib::Request& req, httplib::Response& res) {
|
|
res.set_content(Settings::toJson().dump(), "text/json");
|
|
},
|
|
"json"});
|
|
|
|
HttpServer::AddEndpoint(
|
|
{"/steam_settings",
|
|
HttpServer::Method::GET,
|
|
[](const httplib::Request& req, httplib::Response& res) {
|
|
res.set_content(util::steam::getSteamConfig().dump(4), "text/json");
|
|
},
|
|
"json"});
|
|
|
|
};
|
|
|
|
} // namespace CHTE
|