diff --git a/ino/contact_printer/WebGUI.cpp b/ino/contact_printer/WebGUI.cpp new file mode 100644 index 0000000..ffe70d4 --- /dev/null +++ b/ino/contact_printer/WebGUI.cpp @@ -0,0 +1,26 @@ +#include "WebGUI.h" + +void WebGUI::Setup () { + +} + +void WebGUI::Loop () { + +} + +void WebGUI::HandleNotFound() { + String res = "404 Not Found\n\n"; + res += "URI: "; + res += server.uri(); + res += "\nMethod: "; + res += (server.method() == HTTP_GET) ? "GET" : "POST"; + res += "\nArguments: "; + res += server.args(); + res += "\n"; + + for (uint8_t i = 0; i < server.args(); i++) { + res += " " + server.argName(i) + ": " + server.arg(i) + "\n"; + } + + server.send(404, "text/plain", res); +} \ No newline at end of file diff --git a/ino/contact_printer/WebGUI.h b/ino/contact_printer/WebGUI.h new file mode 100644 index 0000000..4346a79 --- /dev/null +++ b/ino/contact_printer/WebGUI.h @@ -0,0 +1,32 @@ +#ifndef WEBGUI +#define WEBGUI + +#include +#include +#include +#include +#include +#include +#include + +class WebGUI { + private: + const char *AP_SSID = "contact_printer"; + const char *DEFAULT_PASSWORD = "contact_printer"; + const char *MDNS_NAME = "contact_printer"; + //IPAddress wifiIP; + //String IP; + //DynamicJsonDocument postJSON(1024); + WebServer server(80); + + protected: + static void HandleNotFound(); + + public: + WebGUI(); + void Setup(); + void Loop(); + +}; + +#endif \ No newline at end of file