From 6665df4cc6e5987f4b1faa926ac83698b2825897 Mon Sep 17 00:00:00 2001 From: Hendrik Rauh <114620133+HendrikRauh@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:39:41 +0200 Subject: [PATCH] DMX-17 made data-files possible --- data/index.html | 11 +++++++++++ src/main.cpp | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 data/index.html diff --git a/data/index.html b/data/index.html new file mode 100644 index 0000000..9878ae4 --- /dev/null +++ b/data/index.html @@ -0,0 +1,11 @@ + + + + + + Test + + + Your advert could be placed here + + diff --git a/src/main.cpp b/src/main.cpp index 944bec1..cd75af7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include "ESPDMX.h" #include +#include // WiFi stuff const char *ssid = "artnet"; @@ -90,11 +91,17 @@ void setup() Serial.print(size); Serial.println(")");*/ }); + if (!SPIFFS.begin(true)) + { + Serial.println("An Error has occurred while mounting SPIFFS"); + return; + } + server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { Serial.println("ESP32 Web Server: New request received:"); // for debugging Serial.println("GET /"); // for debugging - request->send(200, "text/html", "

Hello, I'm a DMX-INTERFACE!

"); }); + request->send(SPIFFS, "/index.html"); }); server.begin(); Serial.println("Server started!");