Updated backend to make sure it works properly with frontend. Fixed one frontend issue (free heap was not correctly named)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
internal esp_err_t api_system_info_handler(httpd_req_t *req) {
|
||||
httpd_resp_set_type(req, "application/json");
|
||||
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
||||
|
||||
cJSON *root = cJSON_CreateObject();
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ internal void restart_timer_callback(void *arg) { esp_restart(); }
|
||||
|
||||
internal esp_err_t api_system_reboot_handler(httpd_req_t *req) {
|
||||
httpd_resp_set_type(req, "application/json");
|
||||
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
||||
|
||||
cJSON *root = cJSON_CreateObject();
|
||||
cJSON_AddStringToObject(root, "status", "rebooting");
|
||||
|
||||
@@ -107,6 +107,11 @@ extern "C" void app_main() {
|
||||
// Start the webserver
|
||||
web_server = start_webserver();
|
||||
|
||||
// Keep the main task alive indefinitely
|
||||
while (true) {
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
}
|
||||
|
||||
shutdown:
|
||||
printf("Shutting down.\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user