diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-06-20 11:20:47 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-06-20 11:20:47 +0200 |
commit | 1967e3465c7e82d84dc8441ba1993a55050766fb (patch) | |
tree | 1a8703b9dac00f659a774c7892db528df25f7d22 /src/main.cpp | |
parent | a1dbf3f04bde8f98c11f43722e90b20dc832e78c (diff) |
Basic blog module.
EventManager, ContentManager
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index feabb19..cfa08c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,12 +86,20 @@ int main(int argc, char **argv) { } fs.Scan(); - Blog blog; - ContentManager ctmgr; - ctmgr.Register(blog); + ctmgr.RegisterModule(std::make_shared<Blog>("/blog")); + + if (ctmgr.InitAll() == false) + { + std::cout << "InitAll() failed." << std::endl; + return 1; + } EventManager evmgr; - evmgr.setDefaultCallback(example_inja_render, {}); + //evmgr.SetDefaultCallback(example_inja_render, {}); + evmgr.AddCallback("/bla", example_inja_render, {}); + evmgr.AddContentManager(ctmgr); evmgr.Init(host, port); + + //ctmgr.ShutdownAll(); } |