diff --git a/components/protocols/src/rest.c b/components/protocols/src/rest.c index 4e240f2..e3cf77e 100755 --- a/components/protocols/src/rest.c +++ b/components/protocols/src/rest.c @@ -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: