void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response) { response.setChunkedTransferEncoding(true); //response.setContentType("text/html"); Path path(_file); if (File(path).exists()) { std::string mime = "application/binary"; std::string ext = path.getExtension(); if (ext == "html" || ext == "htm" || ext == "js" || ext == "css" || ext == "xml") mime = "text/" + ext; response.sendFile(_file, mime); } else { response.setStatusAndReason(HTTPResponse::HTTP_NOT_FOUND); response.send(); } }
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response) { response.setChunkedTransferEncoding(true); response.sendFile("WebNotifier.html", "text/html"); }