|
@@ -63,8 +63,8 @@ namespace kbf {
|
|
|
}
|
|
|
|
|
|
auto *arg = new HandlerArg{*this, *controller};
|
|
|
- server.route({kbf::http::Method::GET, controller->path, handleGet, arg, handler});
|
|
|
- server.route({kbf::http::Method::POST, controller->path, handlePost, arg, handler});
|
|
|
+ server.route({http::Method::GET, controller->path, handleGet, arg, handler});
|
|
|
+ server.route({http::Method::POST, controller->path, handlePost, arg, handler});
|
|
|
}
|
|
|
|
|
|
class Middleware;
|
|
@@ -117,8 +117,8 @@ namespace kbf {
|
|
|
* @param request
|
|
|
* @return HTTP response
|
|
|
*/
|
|
|
- virtual kbf::http::Response get(const kbf::http::Request &request) {
|
|
|
- return kbf::http::Response("method not allowed", 405);
|
|
|
+ virtual http::Response get(const http::Request &request) {
|
|
|
+ return http::Response("method not allowed", 405);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -127,8 +127,8 @@ namespace kbf {
|
|
|
* @param request
|
|
|
* @return HTTP response
|
|
|
*/
|
|
|
- virtual kbf::http::Response post(const kbf::http::Request &request) {
|
|
|
- return kbf::http::Response("method not allowed", 405);
|
|
|
+ virtual http::Response post(const http::Request &request) {
|
|
|
+ return http::Response("method not allowed", 405);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -136,10 +136,10 @@ namespace kbf {
|
|
|
*
|
|
|
* @param response
|
|
|
*/
|
|
|
- virtual void onResponseSent(const kbf::http::Response &response) {}
|
|
|
+ virtual void onResponseSent(const http::Response &response) {}
|
|
|
|
|
|
private:
|
|
|
- static void responseSentHandler(const kbf::http::Response &response, void *data);
|
|
|
+ static void responseSentHandler(const http::Response &response, void *data);
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -165,7 +165,7 @@ namespace kbf {
|
|
|
};
|
|
|
|
|
|
private:
|
|
|
- kbf::http::Server server;
|
|
|
+ http::Server server;
|
|
|
|
|
|
bool running = false;
|
|
|
int port;
|
|
@@ -175,16 +175,16 @@ namespace kbf {
|
|
|
Controller &controller;
|
|
|
};
|
|
|
|
|
|
- typedef kbf::http::Response (kbf::WebService::Controller::*MethodFunction)(const kbf::http::Request &request);
|
|
|
+ typedef http::Response (WebService::Controller::*MethodFunction)(const http::Request &request);
|
|
|
|
|
|
MethodFunction currentMethod = nullptr;
|
|
|
Controller *currentController = nullptr;
|
|
|
|
|
|
- static kbf::http::Response handleGet(const kbf::http::Request &request, void *data);
|
|
|
+ static http::Response handleGet(const http::Request &request, void *data);
|
|
|
|
|
|
- static kbf::http::Response handlePost(const kbf::http::Request &request, void *data);
|
|
|
+ static http::Response handlePost(const http::Request &request, void *data);
|
|
|
|
|
|
- kbf::http::Response startPipeline(const kbf::http::Request &request, HandlerArg *arg);
|
|
|
+ http::Response startPipeline(const http::Request &request, HandlerArg *arg);
|
|
|
|
|
|
std::vector<Middleware *> middlewares;
|
|
|
std::optional<std::vector<Middleware *>::iterator>
|