Added a new WebRouterNode (skeleton), and made WebRoot inherit from it.

This commit is contained in:
Relintai 2022-01-08 10:06:11 +01:00
parent 3704c031f2
commit 10d3f2fd87
4 changed files with 32 additions and 4 deletions

View File

@ -138,7 +138,7 @@ WebServer *WebRoot::get_server() {
return Object::cast_to<WebServer>(get_tree());
}
WebRoot::WebRoot() : WebNode() {
WebRoot::WebRoot() : WebRouterNode() {
}
WebRoot::~WebRoot() {

View File

@ -1,7 +1,7 @@
#ifndef WEB_ROOT_H
#define WEB_ROOT_H
#include "core/http/web_node.h"
#include "web_router_node.h"
#include <functional>
#include <map>
#include <string>
@ -14,8 +14,8 @@
class Request;
class WebServer;
class WebRoot : public WebNode {
RCPP_OBJECT(WebRoot, WebNode);
class WebRoot : public WebRouterNode {
RCPP_OBJECT(WebRoot, WebRouterNode);
public:
static std::string default_error_404_body;

View File

@ -0,0 +1,12 @@
#include "web_router_node.h"
void WebRouterNode::handle_request_main(Request *request) {
}
WebRouterNode::WebRouterNode() :
WebNode() {
}
WebRouterNode::~WebRouterNode() {
}

View File

@ -0,0 +1,16 @@
#ifndef WEB_ROUTER_NODE_H
#define WEB_ROUTER_NODE_H
#include "web_node.h"
class WebRouterNode : public WebNode {
RCPP_OBJECT(WebRouterNode, WebNode);
public:
void handle_request_main(Request *request);
WebRouterNode();
~WebRouterNode();
};
#endif