Redone protobuf receiving to be more dynamic and scalable

This commit is contained in:
Niklas Jensen
2026-01-24 12:56:19 +01:00
committed by nikguin04
parent d5af8d0294
commit 6e478460f5
4 changed files with 58 additions and 23 deletions
+4 -2
View File
@@ -77,8 +77,10 @@ void setupServer() {
server.on("/api/ap/status", HTTP_GET, [&](httpd_req_t *request) { return apService.getStatusProto(request); });
server.on("/api/ap/settings", HTTP_GET,
[&](httpd_req_t *request) { return apService.protoEndpoint.getState(request); });
server.onRaw("/api/ap/settings", HTTP_POST,
[&](httpd_req_t *request) { return apService.protoEndpoint.handleStateUpdate(request); });
server.onProto("/api/ap/settings", HTTP_POST,
[&](httpd_req_t *request, api_Request *protoReq) {
return apService.protoEndpoint.handleStateUpdate(request, protoReq);
});
server.on("/api/peripherals", HTTP_GET,
[&](httpd_req_t *request) { return peripherals.endpoint.getState(request); });