refactor(req/res): new request/response structure

This commit is contained in:
2026-01-14 02:19:08 +01:00
parent b083c264b8
commit f195bf4202
9 changed files with 380 additions and 166 deletions

20
include/http/handler.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef CWS_HANDLER_H
#define CWS_HANDLER_H
#include "http/request.h"
#include "http/response.h"
/* Configuration for static file serving */
typedef struct cws_handler_config {
const char *root_dir; /*< "www" */
const char *index_file; /*< "index.html" */
} 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