This commit is contained in:
leo 2022-03-22 23:50:39 +01:00
parent b9f879a45c
commit 4fb3bebb0a
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB
2 changed files with 6 additions and 2 deletions

View File

@ -53,6 +53,8 @@ esp_err_t get_handler(httpd_req_t *req){
if(strstr(uri, ".js") != NULL)
httpd_resp_set_type(req, "application/javascript");
if(strstr(uri, ".css") != NULL)
httpd_resp_set_type(req, "text/css");
char chunk[1024];
size_t chunksize;
do {

View File

@ -41,13 +41,15 @@ void app_main(void)
return;
}
HTTP_serve_config_t serv_config = {
HTTP_serve_config_t *serv_config = malloc(sizeof(HTTP_serve_config_t));
*serv_config = (HTTP_serve_config_t) {
.mountpoint = "/http",
.getUri = "/*",
.postUri = "/*",
};
ESP_ERROR_CHECK(start_server(serv_config));
ESP_ERROR_CHECK(start_server(*serv_config));
while(1){
vTaskDelay(100 / portTICK_PERIOD_MS);