feat(config): use toml config file

This commit is contained in:
2026-02-25 19:06:52 +01:00
parent a276e644a7
commit 825c02b626
10 changed files with 73 additions and 36 deletions
+2 -8
View File
@@ -4,17 +4,11 @@
#include "http/request.h"
#include "http/response.h"
/* Configuration for static file serving */
typedef struct cws_handler_config {
const char *root_dir;
const char *index_file;
char *root;
char *domain;
} cws_handler_config_s;
/* Static file handler */
cws_response_s *cws_handler_static_file(cws_request_s *request, cws_handler_config_s *config);
/* Error handlers */
cws_response_s *cws_handler_not_found(cws_request_s *request);
cws_response_s *cws_handler_not_implemented(cws_request_s *request);
#endif
+3
View File
@@ -12,6 +12,7 @@
typedef struct cws_request {
cws_http_method_e method;
string_s *host;
string_s *path;
string_s *query_string;
string_s *http_version;
@@ -21,6 +22,8 @@ typedef struct cws_request {
cws_request_s *cws_http_parse(string_s *request_str);
char *cws_http_get_host(cws_request_s *request);
void cws_http_free(cws_request_s *request);
#endif