|
|
|
@ -21,7 +21,7 @@ limitations under the License.
|
|
|
|
|
#include "AppLauncher.h"
|
|
|
|
|
#include "Settings.h"
|
|
|
|
|
|
|
|
|
|
HttpServer::HttpServer(AppLauncher& app_launcher) : app_launcher_(app_launcher)
|
|
|
|
|
HttpServer::HttpServer(AppLauncher& app_launcher, std::function<void()> close) : app_launcher_(app_launcher), close_(close)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,6 +62,10 @@ void HttpServer::run()
|
|
|
|
|
res.set_content(j.dump(), "text/json");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
server_.Post("/quit", [this](const httplib::Request& req, httplib::Response& res) {
|
|
|
|
|
close_();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
server_.Get("/settings", [this](const httplib::Request& req, httplib::Response& res) {
|
|
|
|
|
res.set_content(Settings::toJson().dump(), "text/json");
|
|
|
|
|
});
|
|
|
|
|