diff --git a/Arduino/CanGrow/include/Webserver/Page_root.h b/Arduino/CanGrow/include/Webserver/Page_root.h index beb52ba..f432f3e 100644 --- a/Arduino/CanGrow/include/Webserver/Page_root.h +++ b/Arduino/CanGrow/include/Webserver/Page_root.h @@ -29,6 +29,21 @@ #include "Page_root_HTML.h" -void WebPage_root(AsyncWebServerRequest *request) { - request->send_P(200, "text/html", Page_root_HTML); +// https://techtutorialsx.com/2018/07/23/esp32-arduino-http-server-template-processing-with-multiple-placeholders/ +String Proc_WebPage_root(const String& var) { + Serial.println(":: [Webserver:Page:root:proc] start"); + Serial.print(":: [Webserver:Page:root:proc] var: "); + Serial.println(var); + + if(var == "LOL") { + return String("omg das geht ja"); + } else if(var == "ROFL") { + return String("rooooooofl geilooooomatic! omg %)"); + } else { + return String(); + } +} + +void WebPage_root(AsyncWebServerRequest *request) { + request->send_P(200, "text/html", Page_root_HTML, Proc_WebPage_root); } diff --git a/Arduino/CanGrow/include/Webserver/Page_root_HTML.h b/Arduino/CanGrow/include/Webserver/Page_root_HTML.h index c1cde90..75807c2 100644 --- a/Arduino/CanGrow/include/Webserver/Page_root_HTML.h +++ b/Arduino/CanGrow/include/Webserver/Page_root_HTML.h @@ -29,5 +29,13 @@ const char* Page_root_HTML PROGMEM = R"( -