diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-04-27 15:15:40 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-04-27 15:15:40 +0200 |
commit | c0483779dac4d8fd5fcc736ae5ffa8ddede0e511 (patch) | |
tree | 42408069a518e15eb1052cc62a09d6855517cf5b /src/main.cpp | |
parent | 51d779256c74cc541da306db5629ed510df5a944 (diff) |
ContentManager / Filesystem classes as preparation for a SimpleBlog.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 9b38c38..ea0f333 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,5 @@ #include "EventManager.hpp" +#include "Filesystem.hpp" #include <event2/buffer.h> @@ -64,6 +65,10 @@ int main(int argc, char **argv) { char const *host = "127.0.0.1"; uint16_t port = 9000; + if (argc <= 1) { + std::cout << "usage: cpp-web [HOST] [PORT] [WWWROOTs..]" << std::endl; + } + if (argc > 1) { host = argv[1]; } @@ -71,6 +76,14 @@ int main(int argc, char **argv) { port = atoi(argv[2]); } + Filesystem fs; + for (auto i = 3; i < argc; ++i) { + if (fs.Scan(argv[i]) != true) { + return 1; + } + } + fs.Scan(); + EventManager evmgr; evmgr.setDefaultCallback(example_inja_render, {}); evmgr.Init(host, port); |