mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Moved html and http from core to a new web folder.
This commit is contained in:
parent
d1e8def48d
commit
80d2a379fe
@ -274,6 +274,7 @@ if scons_ver >= (4, 0, 0):
|
||||
Export("env")
|
||||
|
||||
SConscript("core/SCsub")
|
||||
SConscript("web/SCsub")
|
||||
SConscript("platform/SCsub")
|
||||
|
||||
if env_base["databases"]:
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef DROGON_WEB_SERVER_H
|
||||
#define DROGON_WEB_SERVER_H
|
||||
|
||||
#include "core/http/web_server.h"
|
||||
#include "web/http/web_server.h"
|
||||
|
||||
#include "core/object.h"
|
||||
#include <functional>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "drogon_web_server.h"
|
||||
|
||||
#include "core/http/cookie.h"
|
||||
#include "web/http/cookie.h"
|
||||
|
||||
const String DRequest::get_cookie(const String &key) {
|
||||
return request->getCookie(key);
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "core/string.h"
|
||||
#include "core/containers/vector.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
|
13
web/SCsub
Normal file
13
web/SCsub
Normal file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import("env")
|
||||
|
||||
env.core_sources = []
|
||||
|
||||
env.add_source_files(env.core_sources, "*.cpp")
|
||||
env.add_source_files(env.core_sources, "./html/*.cpp")
|
||||
env.add_source_files(env.core_sources, "./http/*.cpp")
|
||||
|
||||
# Build it all as a library
|
||||
lib = env.add_library("core", env.core_sources)
|
||||
env.Prepend(LIBS=[lib])
|
@ -1,6 +1,6 @@
|
||||
#include "form_validator.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
//FormFieldEntry
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "html_builder.h"
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
HTMLTag *HTMLTag::str(const String &str) {
|
||||
result += " " + str;
|
@ -1,11 +1,11 @@
|
||||
#include "request.h"
|
||||
|
||||
#include "core/http/cookie.h"
|
||||
#include "web/http/cookie.h"
|
||||
#include "web_server.h"
|
||||
|
||||
#include "http_session.h"
|
||||
|
||||
#include "core/http/web_root.h"
|
||||
#include "web/http/web_root.h"
|
||||
#include "session_manager.h"
|
||||
|
||||
Ref<HTTPSession> Request::get_or_create_session() {
|
@ -4,7 +4,7 @@
|
||||
#include "http_enums.h"
|
||||
#include "request.h"
|
||||
|
||||
#include "core/http/web_server.h"
|
||||
#include "web/http/web_server.h"
|
||||
#include "core/settings/settings.h"
|
||||
|
||||
#ifdef DATABASES_ENABLED
|
@ -29,7 +29,7 @@ void WebRoot::setup_middleware() {
|
||||
|
||||
// --- SessionSetupMiddleware ---
|
||||
// If you want sessions add this to your inherited class.
|
||||
// (#include "core/http/session_manager.h")
|
||||
// (#include "web/http/session_manager.h")
|
||||
|
||||
// _middlewares.push_back(Ref<SessionSetupMiddleware>(new SessionSetupMiddleware()));
|
||||
|
||||
@ -48,7 +48,7 @@ void WebRoot::setup_middleware() {
|
||||
// _middlewares.push_back(Ref<RBACDefaultUserSessionSetupMiddleware>(new RBACDefaultUserSessionSetupMiddleware()));
|
||||
|
||||
// --- CSRF Token Middlweare ---
|
||||
// (#include "core/http/csrf_token.h")
|
||||
// (#include "web/http/csrf_token.h")
|
||||
|
||||
// Ref<CSRFTokenMiddleware> csrf_middleware;
|
||||
// csrf_middleware.instance();
|
@ -1,7 +1,7 @@
|
||||
#include "web_server.h"
|
||||
|
||||
#include "request.h"
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
WebNode *WebServer::get_web_root() {
|
||||
return _web_root;
|
@ -1,11 +1,11 @@
|
||||
#include "admin_node.h"
|
||||
|
||||
#include "core/html/form_validator.h"
|
||||
#include "core/html/html_builder.h"
|
||||
#include "core/http/cookie.h"
|
||||
#include "core/http/http_session.h"
|
||||
#include "core/http/request.h"
|
||||
#include "core/http/session_manager.h"
|
||||
#include "web/html/form_validator.h"
|
||||
#include "web/html/html_builder.h"
|
||||
#include "web/http/cookie.h"
|
||||
#include "web/http/http_session.h"
|
||||
#include "web/http/request.h"
|
||||
#include "web/http/session_manager.h"
|
||||
|
||||
void AdminNode::admin_handle_request_main(Request *request) {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef ADMIN_NODE_H
|
||||
#define ADMIN_NODE_H
|
||||
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
#include "core/containers/vector.h"
|
||||
#include "core/string.h"
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "admin_panel.h"
|
||||
|
||||
#include "core/html/form_validator.h"
|
||||
#include "core/html/html_builder.h"
|
||||
#include "core/http/cookie.h"
|
||||
#include "core/http/http_session.h"
|
||||
#include "core/http/request.h"
|
||||
#include "core/http/session_manager.h"
|
||||
#include "web/html/form_validator.h"
|
||||
#include "web/html/html_builder.h"
|
||||
#include "web/http/cookie.h"
|
||||
#include "web/http/http_session.h"
|
||||
#include "web/http/request.h"
|
||||
#include "web/http/session_manager.h"
|
||||
|
||||
#include "admin_node.h"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef ADMIN_PANEL_H
|
||||
#define ADMIN_PANEL_H
|
||||
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
#include "core/string.h"
|
||||
#include "core/containers/vector.h"
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "static_folder_page.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
#include <iostream>
|
||||
#include "core/file_cache.h"
|
||||
#include "core/database/database_manager.h"
|
||||
#include "core/html/html_builder.h"
|
||||
#include "web/html/html_builder.h"
|
||||
|
||||
void StaticFolderPage::handle_request_main(Request *request) {
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
//StaticFolderPage
|
||||
//Just serve files
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "list_page.h"
|
||||
|
||||
#include "core/html/html_builder.h"
|
||||
#include "core/html/utils.h"
|
||||
#include "web/html/html_builder.h"
|
||||
#include "web/html/utils.h"
|
||||
#include "core/math/math.h"
|
||||
|
||||
#include <tinydir/tinydir.h>
|
||||
|
@ -4,9 +4,9 @@
|
||||
#include "core/containers/vector.h"
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
// This class will load and generate pages from a folder of md files. It supports pagination,
|
||||
// it will put entry_per_page md files per page. It generates html on enter tree, and caches everything.
|
||||
|
@ -4,9 +4,9 @@
|
||||
#include "core/containers/vector.h"
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
|
||||
class MessagePage : public WebNode {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "paged_article.h"
|
||||
|
||||
#include "core/os/directory.h"
|
||||
#include "core/html/utils.h"
|
||||
#include "web/html/utils.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/file_cache.h"
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
class PagedArticle : public WebNode {
|
||||
RCPP_OBJECT(PagedArticle, WebNode);
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "paged_articles.h"
|
||||
|
||||
#include "core/html/html_builder.h"
|
||||
#include "web/html/html_builder.h"
|
||||
|
||||
#include "core/os/directory.h"
|
||||
#include "core/html/utils.h"
|
||||
#include "web/html/utils.h"
|
||||
#include "paged_article.h"
|
||||
|
||||
#include <iostream>
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/file_cache.h"
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
//todo pagination
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "paged_articles_md_index.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
#include "core/html/html_builder.h"
|
||||
#include "web/html/html_builder.h"
|
||||
|
||||
void PagedArticlesMDIndex::handle_request_main(Request *request) {
|
||||
const String path = request->get_current_path_segment();
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
#include "web_modules/list_page/list_page.h"
|
||||
#include "web_modules/paged_article/paged_article.h"
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
#include "core/error_macros.h"
|
||||
|
||||
#include "core/html/form_validator.h"
|
||||
#include "core/html/html_builder.h"
|
||||
#include "core/http/cookie.h"
|
||||
#include "core/http/http_session.h"
|
||||
#include "core/http/request.h"
|
||||
#include "core/http/session_manager.h"
|
||||
#include "web/html/form_validator.h"
|
||||
#include "web/html/html_builder.h"
|
||||
#include "web/http/cookie.h"
|
||||
#include "web/http/http_session.h"
|
||||
#include "web/http/request.h"
|
||||
#include "web/http/session_manager.h"
|
||||
#include "rbac_default_permissions.h"
|
||||
#include "web_modules/users/user.h"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "rbac_rank.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
Ref<RBACPermission> RBACRank::match_request(Request *request) {
|
||||
const String &full_path = request->get_path_full();
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "rbac_user_controller.h"
|
||||
|
||||
#include "core/http/http_session.h"
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/http_session.h"
|
||||
#include "web/http/request.h"
|
||||
|
||||
#include "web_modules/rbac/rbac_controller.h"
|
||||
#include "web_modules/rbac/rbac_default_permissions.h"
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "web_modules/users/user_controller.h"
|
||||
|
||||
#include "core/http/middleware.h"
|
||||
#include "web/http/middleware.h"
|
||||
|
||||
class Request;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "static_page.h"
|
||||
|
||||
#include "core/http/request.h"
|
||||
#include "web/http/request.h"
|
||||
#include "core/file_cache.h"
|
||||
#include "core/html/html_builder.h"
|
||||
#include "web/html/html_builder.h"
|
||||
|
||||
void StaticPage::handle_request_main(Request *request) {
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
/*
|
||||
|
||||
|
@ -13,13 +13,13 @@
|
||||
#include "core/database/query_result.h"
|
||||
#include "core/database/table_builder.h"
|
||||
|
||||
#include "core/html/form_validator.h"
|
||||
#include "core/html/html_builder.h"
|
||||
#include "core/http/cookie.h"
|
||||
#include "core/http/http_session.h"
|
||||
#include "core/http/request.h"
|
||||
#include "core/http/session_manager.h"
|
||||
#include "core/html/utils.h"
|
||||
#include "web/html/form_validator.h"
|
||||
#include "web/html/html_builder.h"
|
||||
#include "web/http/cookie.h"
|
||||
#include "web/http/http_session.h"
|
||||
#include "web/http/request.h"
|
||||
#include "web/http/session_manager.h"
|
||||
#include "web/html/utils.h"
|
||||
|
||||
String User::to_json(rapidjson::Document *into) {
|
||||
rapidjson::Document *document;
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "user_controller.h"
|
||||
|
||||
#include "core/html/form_validator.h"
|
||||
#include "core/html/html_builder.h"
|
||||
#include "core/http/cookie.h"
|
||||
#include "core/http/http_session.h"
|
||||
#include "core/http/request.h"
|
||||
#include "core/http/session_manager.h"
|
||||
#include "web/html/form_validator.h"
|
||||
#include "web/html/html_builder.h"
|
||||
#include "web/http/cookie.h"
|
||||
#include "web/http/http_session.h"
|
||||
#include "web/http/request.h"
|
||||
#include "web/http/session_manager.h"
|
||||
|
||||
#include "core/database/database.h"
|
||||
#include "core/database/database_manager.h"
|
||||
|
@ -4,10 +4,10 @@
|
||||
#include "core/containers/vector.h"
|
||||
#include "core/string.h"
|
||||
|
||||
#include "core/http/web_node.h"
|
||||
#include "web/http/web_node.h"
|
||||
|
||||
#include "user.h"
|
||||
#include "core/http/middleware.h"
|
||||
#include "web/http/middleware.h"
|
||||
|
||||
class Request;
|
||||
class FormValidator;
|
||||
|
Loading…
Reference in New Issue
Block a user