diff --git a/src/web_server.cpp b/src/web_server.cpp index f86e163..eed8ffd 100644 --- a/src/web_server.cpp +++ b/src/web_server.cpp @@ -183,6 +183,12 @@ void AppWebServer::setupAPIRoutes() { req->send(200, "application/json", response); }); + _server.on("/api/action/sync-time", HTTP_POST, + [this](AsyncWebServerRequest* req) { + _wifi->syncNTP(); + req->send(200, "application/json", "{\"ok\":true,\"msg\":\"RTC synced\"}"); + }); + _server.on("/api/action/reboot", HTTP_POST, [](AsyncWebServerRequest* req) { req->send(200, "application/json", "{\"ok\":true,\"msg\":\"Rebooting...\"}");