Enthernet Code
Enthernet Code
DIIDevHeads IoT Integration Server
Created by te0 on 7/30/2024 in #edge-networking
How to send HTML page from a Web Server asynchronously in ESP-IDF?
And then setup the sever to call on the handler upon user request
void start_webserver(void) {
httpd_handle_t server = NULL;
httpd_config_t config = HTTPD_DEFAULT_CONFIG();

if (httpd_start(&server, &config) == ESP_OK) {
httpd_uri_t html_uri = {
.uri = "/",
.method = HTTP_GET,
.handler = html_get_handler,
.user_ctx = NULL
};
httpd_register_uri_handler(server, &html_uri);
}
}
void start_webserver(void) {
httpd_handle_t server = NULL;
httpd_config_t config = HTTPD_DEFAULT_CONFIG();

if (httpd_start(&server, &config) == ESP_OK) {
httpd_uri_t html_uri = {
.uri = "/",
.method = HTTP_GET,
.handler = html_get_handler,
.user_ctx = NULL
};
httpd_register_uri_handler(server, &html_uri);
}
}
11 replies