add: content_dir config

This commit is contained in:
Tobias Reisinger 2020-07-02 00:16:07 +02:00
parent ab02ebc238
commit 77b2fafaff
6 changed files with 14 additions and 3 deletions

View file

@ -59,6 +59,7 @@ main(int argc, const char** argv)
strcpy(global_config.user, "");
strcpy(global_config.group, "");
strcpy(global_config.content_dir, ".");
strcpy(global_config.not_found_file, "404.html");
strcpy(global_config.not_found_file_type, "text/html");
strcpy(global_config.not_found_content, "404 - NOT FOUND");
@ -81,7 +82,7 @@ main(int argc, const char** argv)
fclose(ini_file);
memset(&global_config.http_server_opts, 0, sizeof(global_config.http_server_opts));
global_config.http_server_opts.document_root = "."; // Serve current directory
global_config.http_server_opts.document_root = global_config.content_dir;
global_config.http_server_opts.enable_directory_listing = "no";
global_config.http_server_opts.extra_headers = "Access-Control-Allow-Origin: *\r\nAccess-Control-Allow-Headers: *\r\nAccess-Control-Allow-Methods: *";