Template
1
0

Fixed write data... again. Fuck my programmer life.

This commit is contained in:
2025-07-05 01:17:05 +03:00
parent fb3f1e7c37
commit 809c833259
4 changed files with 47 additions and 16 deletions

View File

@@ -8,16 +8,16 @@
// So just add your logic here and relax ;)
std::unordered_map<
std::string,
std::unordered_map<std::string, std::function<void(HTTPrequest &self)>>>
std::unordered_map<std::string, std::function<void(HTTPrequest *self)>>>
Webserver::responseMethods;
void Webserver::initResponses() {
responseMethods["GET"]["/"] = [](HTTPrequest &self) {
self.sendResponse("200 OK", "text/html",
Helpers::ReadFile("www/index.html"));
responseMethods["GET"]["/"] = [](HTTPrequest *self) {
self->sendResponse("200 OK", "text/html",
Helpers::ReadFile("www/index.html"));
};
responseMethods["POST"]["/upload"] = [](HTTPrequest &self) {
self.sendResponse("200 OK", "text/text", self.bodyContent);
responseMethods["POST"]["/upload"] = [](HTTPrequest *self) {
self->sendResponse("200 OK", "text/text", self->bodyContent);
};
}