This repository was archived by the owner on Jun 12, 2018. It is now read-only.
File tree 2 files changed +4
-4
lines changed 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -89,13 +89,13 @@ int main() {
89
89
90
90
// GET-example for the path /match/[number], responds with the matched string in path (number)
91
91
// For instance a request GET /match/123 will receive: 123
92
- server.resource [" ^/match/([0-9]+)$" ][" GET" ]=[&server ](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> request) {
92
+ server.resource [" ^/match/([0-9]+)$" ][" GET" ]=[](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> request) {
93
93
string number=request->path_match [1 ];
94
94
*response << " HTTP/1.1 200 OK\r\n Content-Length: " << number.length () << " \r\n\r\n " << number;
95
95
};
96
96
97
97
// Get example simulating heavy work in a separate thread
98
- server.resource [" ^/work$" ][" GET" ]=[&server ](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> /* request*/ ) {
98
+ server.resource [" ^/work$" ][" GET" ]=[](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> /* request*/ ) {
99
99
thread work_thread ([response] {
100
100
this_thread::sleep_for (chrono::seconds (5 ));
101
101
string message=" Work done" ;
Original file line number Diff line number Diff line change @@ -87,13 +87,13 @@ int main() {
87
87
88
88
// GET-example for the path /match/[number], responds with the matched string in path (number)
89
89
// For instance a request GET /match/123 will receive: 123
90
- server.resource [" ^/match/([0-9]+)$" ][" GET" ]=[&server ](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> request) {
90
+ server.resource [" ^/match/([0-9]+)$" ][" GET" ]=[](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> request) {
91
91
string number=request->path_match [1 ];
92
92
*response << " HTTP/1.1 200 OK\r\n Content-Length: " << number.length () << " \r\n\r\n " << number;
93
93
};
94
94
95
95
// Get example simulating heavy work in a separate thread
96
- server.resource [" ^/work$" ][" GET" ]=[&server ](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> /* request*/ ) {
96
+ server.resource [" ^/work$" ][" GET" ]=[](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> /* request*/ ) {
97
97
thread work_thread ([response] {
98
98
this_thread::sleep_for (chrono::seconds (5 ));
99
99
string message=" Work done" ;
You can’t perform that action at this time.
0 commit comments