From 4e2ef6f1e9632430718568e49aa1b8770b7069b3 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 28 Nov 2020 14:52:46 +0100 Subject: [PATCH] Temporary printf()'s per db backend for main. --- main.cpp | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/main.cpp b/main.cpp index 0df776f..d1f4f22 100644 --- a/main.cpp +++ b/main.cpp @@ -1,23 +1,36 @@ #include #include -#include "core/http_server.h" #include "core/application.h" #include "core/file_cache.h" +#include "core/http_server.h" #include "rdn_application.h" #define MAIN_CLASS RDNApplication int main(int argc, char **argv) { - FileCache *file_cache = new FileCache(true); - file_cache->wwwroot = "./www"; - file_cache->wwwroot_refresh_cache(); - Application *app = new MAIN_CLASS(); +#if MYSQL_PRESENT + printf("mysql present\n"); +#endif - app->setup_routes(); - app->setup_middleware(); +#if PGSQL_PRESENT + printf("pgsql present\n"); +#endif + +#if SQLITE_PRESENT + printf("sqlite present\n"); +#endif + + FileCache *file_cache = new FileCache(true); + file_cache->wwwroot = "./www"; + file_cache->wwwroot_refresh_cache(); + + Application *app = new MAIN_CLASS(); + + app->setup_routes(); + app->setup_middleware(); HTTPServer *server = new HTTPServer(); @@ -26,8 +39,8 @@ int main(int argc, char **argv) { server->main_loop(); delete server; - delete app; - delete file_cache; + delete app; + delete file_cache; return 0; } \ No newline at end of file