diff --git a/http_examples.cpp b/http_examples.cpp index e88d9929..e15ae54a 100644 --- a/http_examples.cpp +++ b/http_examples.cpp @@ -89,13 +89,13 @@ int main() { //GET-example for the path /match/[number], responds with the matched string in path (number) //For instance a request GET /match/123 will receive: 123 - server.resource["^/match/([0-9]+)$"]["GET"]=[&server](shared_ptr response, shared_ptr request) { + server.resource["^/match/([0-9]+)$"]["GET"]=[](shared_ptr response, shared_ptr request) { string number=request->path_match[1]; *response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length() << "\r\n\r\n" << number; }; //Get example simulating heavy work in a separate thread - server.resource["^/work$"]["GET"]=[&server](shared_ptr response, shared_ptr /*request*/) { + server.resource["^/work$"]["GET"]=[](shared_ptr response, shared_ptr /*request*/) { thread work_thread([response] { this_thread::sleep_for(chrono::seconds(5)); string message="Work done"; diff --git a/https_examples.cpp b/https_examples.cpp index 91bcfa5a..14ae4605 100644 --- a/https_examples.cpp +++ b/https_examples.cpp @@ -87,13 +87,13 @@ int main() { //GET-example for the path /match/[number], responds with the matched string in path (number) //For instance a request GET /match/123 will receive: 123 - server.resource["^/match/([0-9]+)$"]["GET"]=[&server](shared_ptr response, shared_ptr request) { + server.resource["^/match/([0-9]+)$"]["GET"]=[](shared_ptr response, shared_ptr request) { string number=request->path_match[1]; *response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length() << "\r\n\r\n" << number; }; //Get example simulating heavy work in a separate thread - server.resource["^/work$"]["GET"]=[&server](shared_ptr response, shared_ptr /*request*/) { + server.resource["^/work$"]["GET"]=[](shared_ptr response, shared_ptr /*request*/) { thread work_thread([response] { this_thread::sleep_for(chrono::seconds(5)); string message="Work done";