HttpServer: endpoint to query shortcut settings

pull/192/head
Peter Repukat 2 years ago
parent a1c1a7d141
commit 31ce36095f

@ -19,9 +19,11 @@ limitations under the License.
#include <nlohmann/json.hpp>
#include "AppLauncher.h"
#include "Settings.h"
HttpServer::HttpServer(AppLauncher& app_launcher) : app_launcher_(app_launcher)
{}
{
}
void HttpServer::run()
{
@ -30,6 +32,10 @@ void HttpServer::run()
res.set_content(j.dump(), "text/json");
});
server_.Get("/settings", [this](const httplib::Request& req, httplib::Response& res) {
res.set_content(Settings::toJson().dump(), "text/json");
});
server_thread_ = std::thread([this]() {
if (!server_.listen("0.0.0.0", port_)) {
spdlog::error("Couldn't start http-server");

Loading…
Cancel
Save