First stab at new router

This commit is contained in:
Alex Hultman
2019-12-26 00:32:02 +01:00
parent 5ab190f430
commit d3b43e3fa1
3 changed files with 112 additions and 148 deletions
+3 -3
View File
@@ -248,11 +248,11 @@ public:
/* Tell the router that we did not handle this request */
req->setYield(true);
}
}));
}, true));
}
TemplatedApp &&get(std::string pattern, fu2::unique_function<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
httpContext->onHttp("get", pattern, std::move(handler));
TemplatedApp &&get(std::string pattern, fu2::unique_function<void(HttpResponse<SSL> *, HttpRequest *)> &&handler, bool upgrade = false) {
httpContext->onHttp("get", pattern, std::move(handler), upgrade);
return std::move(*this);
}