Fix REST server initialization
This commit is contained in:
@@ -718,6 +718,9 @@ esp_err_t rest_init(const char *base_path)
|
|||||||
config.max_uri_handlers = 30; // Ajuste conforme necessário
|
config.max_uri_handlers = 30; // Ajuste conforme necessário
|
||||||
config.uri_match_fn = httpd_uri_match_wildcard;
|
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
|
// Registrar manipuladores de URI para as configurações
|
||||||
httpd_uri_t config_load_balancing_get_uri = {
|
httpd_uri_t config_load_balancing_get_uri = {
|
||||||
.uri = "/api/v1/config/load-balancing",
|
.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);
|
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;
|
return ESP_OK;
|
||||||
|
|
||||||
err_start:
|
err_start:
|
||||||
|
|||||||
Reference in New Issue
Block a user