drogon/examples/simple_example/ForwardCtrl.cc

13 lines
404 B
C++

#include "ForwardCtrl.h"
void ForwardCtrl::asyncHandleHttpRequest(
const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback)
{
req->setPath("/repos/an-tao/drogon/git/refs/heads/master");
app().forward(
req,
[callback = std::move(callback)](const HttpResponsePtr &resp) {
callback(resp);
},
"https://api.github.com");
}