mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Moved get_server from WebRoot to WebNode.
This commit is contained in:
parent
f00e5c5c9e
commit
d873312915
@ -1,10 +1,11 @@
|
|||||||
|
|
||||||
#include "web_node.h"
|
#include "web_node.h"
|
||||||
|
|
||||||
#include "request.h"
|
|
||||||
#include "http_enums.h"
|
#include "http_enums.h"
|
||||||
|
#include "request.h"
|
||||||
|
|
||||||
#include "core/settings/settings.h"
|
#include "core/settings/settings.h"
|
||||||
|
#include "core/http/web_server.h"
|
||||||
|
|
||||||
#ifdef DATABASES_ENABLED
|
#ifdef DATABASES_ENABLED
|
||||||
#include "core/database/database.h"
|
#include "core/database/database.h"
|
||||||
@ -94,6 +95,11 @@ void WebNode::migrate() {
|
|||||||
void WebNode::create_default_entries() {
|
void WebNode::create_default_entries() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WebServer *WebNode::get_server() {
|
||||||
|
// todo this shoult probably be cached
|
||||||
|
return Object::cast_to<WebServer>(get_tree());
|
||||||
|
}
|
||||||
|
|
||||||
WebNode::WebNode() :
|
WebNode::WebNode() :
|
||||||
Node() {
|
Node() {
|
||||||
// should look this up in parents when parented (and node parenting is implemented)
|
// should look this up in parents when parented (and node parenting is implemented)
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
class Request;
|
class Request;
|
||||||
class Settings;
|
class Settings;
|
||||||
|
class WebServer;
|
||||||
|
|
||||||
#ifdef DATABASES_ENABLED
|
#ifdef DATABASES_ENABLED
|
||||||
class DataBase;
|
class DataBase;
|
||||||
@ -41,6 +42,8 @@ public:
|
|||||||
virtual void migrate();
|
virtual void migrate();
|
||||||
virtual void create_default_entries();
|
virtual void create_default_entries();
|
||||||
|
|
||||||
|
WebServer *get_server();
|
||||||
|
|
||||||
WebNode();
|
WebNode();
|
||||||
~WebNode();
|
~WebNode();
|
||||||
|
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "core/http/web_server.h"
|
|
||||||
|
|
||||||
void WebRoot::load_settings() {
|
void WebRoot::load_settings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,11 +163,6 @@ void WebRoot::update() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebServer *WebRoot::get_server() {
|
|
||||||
// todo this shoult probably be cached
|
|
||||||
return Object::cast_to<WebServer>(get_tree());
|
|
||||||
}
|
|
||||||
|
|
||||||
WebRoot::WebRoot() :
|
WebRoot::WebRoot() :
|
||||||
WebRouterNode() {
|
WebRouterNode() {
|
||||||
}
|
}
|
||||||
|
@ -12,21 +12,19 @@
|
|||||||
#include "handler_instance.h"
|
#include "handler_instance.h"
|
||||||
|
|
||||||
class Request;
|
class Request;
|
||||||
class WebServer;
|
|
||||||
|
|
||||||
//Middleware turn into a class (reference)
|
//Middleware turn into a class (reference)
|
||||||
//add them to a folder
|
//add them to a folder
|
||||||
//method should return bool -> true to continue, false if done
|
//method should return bool -> true to continue, false if done
|
||||||
|
|
||||||
//Error handlers
|
|
||||||
//Add to WebNode api -> send_error(code) v handle_error_send_request(request, int error, variant additional data ?);
|
|
||||||
//have generic one implemented by default
|
|
||||||
//Webroot overrides -> uses same logic as now
|
|
||||||
|
|
||||||
//notification -> variant additional data?
|
|
||||||
|
|
||||||
//FileCache -> set up, for this webroot, don't use singleton
|
//FileCache -> set up, for this webroot, don't use singleton
|
||||||
|
|
||||||
|
//clean up unused things here
|
||||||
|
//remove handler instances!
|
||||||
|
|
||||||
|
//Update the rest of the modules to the new systems
|
||||||
|
|
||||||
|
|
||||||
class WebRoot : public WebRouterNode {
|
class WebRoot : public WebRouterNode {
|
||||||
RCPP_OBJECT(WebRoot, WebRouterNode);
|
RCPP_OBJECT(WebRoot, WebRouterNode);
|
||||||
|
|
||||||
@ -56,8 +54,6 @@ public:
|
|||||||
void unregister_request_update(Request *request);
|
void unregister_request_update(Request *request);
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
WebServer *get_server();
|
|
||||||
|
|
||||||
WebRoot();
|
WebRoot();
|
||||||
virtual ~WebRoot();
|
virtual ~WebRoot();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user