From 55474b485f3585c01dc582ad95ba2c19c89b99c6 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Sun, 27 Nov 2022 19:49:38 +0100 Subject: [PATCH] feat: add very simple index page linking to my site --- src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 9812e27..01fbf8d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,16 @@ extern "C" { #include "ternarytrie.h" } +static const std::string index_page = R"( + + + +

r8r.be

+

This is the URL shortener and pastebin accompanying my site, The Rusty Bever.

+ + +)"; + #define ENV(var, env_var) \ const char *_##var = getenv(env_var); \ if (_##var == NULL) { \ @@ -102,6 +112,9 @@ int main() { crow::SimpleApp app; app.loglevel(crow::LogLevel::Info); + CROW_ROUTE(app, "/").methods(crow::HTTPMethod::Get)( + []() { return crow::response("html", index_page); }); + // Serve an entry CROW_ROUTE(app, "/") .methods(crow::HTTPMethod::Get)(