Browse Source

try to make test_webserver compile again. But I got weird linker errors with boost.

pull/1/head
roker 2 years ago
parent
commit
d26bdb069b
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      test_webserver.cc

+ 4
- 4
test_webserver.cc View File

@ -6,16 +6,16 @@
int main()
{
std::cout << "serving http://127.0.0.1:8080/test.html\n";
pEp::Webserver web{net::ip::address::from_string("127.0.0.1"), 8080, "htdocs"};
pEp::Webserver web{pEp::net::ip::address::from_string("127.0.0.1"), 8080, "htdocs"};
std::cout << "adding handler for http://127.0.0.1:8080/handler/sample\n";
web.add_url_handler("/handler/(?<name>\\w+)",
[](boost::cmatch m, pEp::Webserver::request& req)->pEp::Webserver::response* {
pEp::Webserver::response *res = new pEp::Webserver::response{http::status::ok, req.version()};
[](boost::cmatch m, const pEp::Webserver::request& req)->pEp::Webserver::response* {
pEp::Webserver::response *res = new pEp::Webserver::response{pEp::http::status::ok, req.version()};
// https://www.boost.org/doc/libs/1_73_0/libs/beast/doc/html/beast/ref/boost__beast__http__response.html
res->set(http::field::content_type, "text/json; charset=utf-8");
res->set(pEp::http::field::content_type, "text/json; charset=utf-8");
res->keep_alive(req.keep_alive());
res->body() =


Loading…
Cancel
Save