Refactor Web Server

This commit is contained in:
dark98
2026-09-03 02:12:07 +01:00
parent 7bde605438
commit ee046a001e
8 changed files with 271 additions and 78 deletions
+21
View File
@@ -0,0 +1,21 @@
#include "web_server.h"
#include "web_server_pages.h"
#include "esp_http_server.h"
#include "esp_log.h"
static const char *TAG = "SYS_WEB";
static httpd_handle_t s_server;
esp_err_t web_server_start(void)
{
if (s_server) return ESP_OK;
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
esp_err_t err = httpd_start(&s_server, &config);
if (err != ESP_OK) return err;
web_server_register_wifi_pages(s_server);
web_server_register_ota_page(s_server);
ESP_LOGI(TAG, "Web server started");
return ESP_OK;
}