Fixed write data... again. Fuck my programmer life.
This commit is contained in:
@@ -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);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user