5 #ifndef JODA_JODASERVER_H
6 #define JODA_JODASERVER_H
8 #include <glog/logging.h>
25 : std::runtime_error(
"API Error: " + what){};
38 static constexpr
auto prefix =
"/api";
46 bool start(
const std::string &addr,
int port);
88 httplib::Server server;
90 static std::string printParameters(
const httplib::Params &p);
92 static void favicon(
const httplib::Request &req, httplib::Response &res);
110 const std::string &what)
rapidjson::GenericDocument< RJChar, RJMemoryPoolAlloc, RJBaseAlloc > RJDocument
Definition: RJFwd.h:28
void stop()
Definition: Timer.cpp:22
std::string toHumanDuration() const
Definition: Timer.cpp:60
Definition: JodaServer.h:18
JodaAPIException(const std::string &what)
Definition: JodaServer.h:24
Definition: JodaServer.h:107
JodaInvalidParameterException(const std::string ¶m, const std::string &what)
Definition: JodaServer.h:109
Definition: JodaServer.h:98
JodaMissingParameterException(const std::string ¶m)
Definition: JodaServer.h:100
Definition: JodaServer.h:32
static void sendResponse(RJDocument &doc, httplib::Response &res)
Definition: JodaServer.cpp:56
static void logExecutionTime(const std::string &endpoint, F f)
Definition: JodaServer.h:80
void stop()
Definition: JodaServer.cpp:65
static constexpr auto prefix
Definition: JodaServer.h:38
bool start(const std::string &addr, int port)
Definition: JodaServer.cpp:16
static void handleError(JodaAPIException &e, httplib::Response &res)
Definition: JodaServer.cpp:47
Definition: JodaClient.h:12