diff options
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); |