Fixing pistache usage so make builds cleanly
This commit is contained in:
@@ -11,7 +11,7 @@ namespace daggy {
|
||||
public:
|
||||
Server(Pistache::Address addr)
|
||||
: endpoint_(addr)
|
||||
, desc("Daggy API", "0.1")
|
||||
, desc_("Daggy API", "0.1")
|
||||
{}
|
||||
|
||||
void init(int threads = 1);
|
||||
@@ -23,7 +23,7 @@ namespace daggy {
|
||||
|
||||
Pistache::Http::Endpoint endpoint_;
|
||||
Pistache::Rest::Description desc_;
|
||||
Pistache::Http::Router router_;
|
||||
Pistache::Rest::Router router_;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
#include <daggy/Server.hpp>
|
||||
|
||||
using namespace Pistache;
|
||||
|
||||
namespace daggy {
|
||||
void Server::init(int threads = 1) {
|
||||
void Server::init(int threads) {
|
||||
auto opts = Http::Endpoint::options()
|
||||
.threads(threads)
|
||||
;
|
||||
endpoint_->init(opts);
|
||||
endpoint_.init(opts);
|
||||
createDescription();
|
||||
}
|
||||
|
||||
void Server::start() {
|
||||
router.initFromDescription(desc_);
|
||||
router_.initFromDescription(desc_);
|
||||
|
||||
httpEndpoint->setHandler(router.handler());
|
||||
httpEndpoint->serve();
|
||||
endpoint_.setHandler(router_.handler());
|
||||
endpoint_.serve();
|
||||
}
|
||||
|
||||
void Server::createDescription() {
|
||||
@@ -31,11 +33,13 @@ namespace daggy {
|
||||
.produces(MIME(Application, Json))
|
||||
.consumes(MIME(Application, Json));
|
||||
|
||||
/*
|
||||
desc_
|
||||
.route(desc_.get("/ready"))
|
||||
.bind(&Generic::handleReady)
|
||||
.response(Http::Code::Ok, "Response to the /ready call")
|
||||
.hide();
|
||||
*/
|
||||
|
||||
auto versionPath = desc_.path("/v1");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user