Merge pull request #2 from PlxEV/codex/corrigir-e-melhorar-componente-protocols

Fix REST server startup order
This commit is contained in:
2025-06-07 14:19:45 +01:00
committed by GitHub

View File

@@ -718,6 +718,9 @@ esp_err_t rest_init(const char *base_path)
config.max_uri_handlers = 30; // Ajuste conforme necessário
config.uri_match_fn = httpd_uri_match_wildcard;
ESP_LOGI(REST_TAG, "Starting HTTP Server");
REST_CHECK(httpd_start(&server, &config) == ESP_OK, "Start server failed", err_start);
// Registrar manipuladores de URI para as configurações
httpd_uri_t config_load_balancing_get_uri = {
.uri = "/api/v1/config/load-balancing",
@@ -885,10 +888,6 @@ esp_err_t rest_init(const char *base_path)
};
httpd_register_uri_handler(server, &common_get_uri);
// Finalmente, inicie o servidor
ESP_LOGI(REST_TAG, "Starting HTTP Server");
REST_CHECK(httpd_start(&server, &config) == ESP_OK, "Start server failed", err_start);
return ESP_OK;
err_start: