Moved SimpleWeb::string_view to utility.hpp, and made use of string_view in Server::Response::write

This commit is contained in:
eidheim 2018-07-12 08:43:07 +02:00
commit 56b1df1ee5
5 changed files with 20 additions and 20 deletions

View file

@ -108,7 +108,7 @@ 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"] = [](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> request) {
response->write(request->path_match[1]);
response->write(request->path_match[1].str());
};
// GET-example simulating heavy work in a separate thread