-
Notifications
You must be signed in to change notification settings - Fork 11
Allow supplying callbacks for specific endpoints in the API server. #93
Conversation
77644ee
to
146bdd5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
: handler_(config, store), | ||
: config_(config), store_(store), dispatcher_({ | ||
{{"GET", "/monitoredResource/"}, | ||
[=](const HttpServer::request& request, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to just pass HandleMonitoredResource, without doing so in a lambda? This would work in Javascript, but I know C++ is much stricter than javascript, I think anything is stricter than Javascript :-P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because we also need to capture this
. If there were no capture, you could indeed convert a function pointer into an std::function
.
if (config_.VerboseLogging()) { | ||
LOG(INFO) << "Found resource for " << id << ": " << resource; | ||
} | ||
conn->set_status(HttpServer::connection::ok); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you rebase off of master with the latest header updates and 404 response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, done.
146bdd5
to
b1376e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL.
: handler_(config, store), | ||
: config_(config), store_(store), dispatcher_({ | ||
{{"GET", "/monitoredResource/"}, | ||
[=](const HttpServer::request& request, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because we also need to capture this
. If there were no capture, you could indeed convert a function pointer into an std::function
.
if (config_.VerboseLogging()) { | ||
LOG(INFO) << "Found resource for " << id << ": " << resource; | ||
} | ||
conn->set_status(HttpServer::connection::ok); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.