From a83917beb806596988762943d3173a0109dc4a4d Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 18 May 2024 16:52:53 +0500 Subject: feat: mustache templates --- templates/index.html | 8 ++++++++ web/src/main.cpp | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 templates/index.html diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..ccb2525 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,8 @@ + + + + + +

hi

+ + diff --git a/web/src/main.cpp b/web/src/main.cpp index 248328f..2b4aaba 100644 --- a/web/src/main.cpp +++ b/web/src/main.cpp @@ -1,9 +1,15 @@ #include "crow/app.h" +#include "crow/mustache.h" int main(int argc, char *argv[]) { crow::SimpleApp app; - CROW_ROUTE(app, "/")([]() { return "hi"; }); + CROW_ROUTE(app, "/") + ([]() { + auto page = crow::mustache::load_text("index.html"); + + return page; + }); app.multithreaded().port(18083).run(); return 0; -- cgit v1.2.3