refactor
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#include "esp_http_server.h"
|
||||
#include "ygg_http_server.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
static const char *TAG = "YGG_HTTP_SERVER";
|
||||
|
||||
httpd_handle_t ygg_start_webserver(void)
|
||||
{
|
||||
httpd_handle_t server = NULL;
|
||||
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||
|
||||
ESP_LOGI(TAG, "Starting http server on port: %d", config.server_port);
|
||||
if (httpd_start(&server, &config) == ESP_OK) {
|
||||
return server;
|
||||
}
|
||||
|
||||
ESP_LOGE(TAG, "Error starting server!");
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user