DMX-17 made data-files possible

This commit is contained in:
Hendrik Rauh 2024-10-24 18:39:41 +02:00
parent ab1e60ba03
commit 6665df4cc6
2 changed files with 19 additions and 1 deletions

11
data/index.html Normal file
View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test</title>
</head>
<body>
Your advert could be placed here
</body>
</html>

View file

@ -3,6 +3,7 @@
#include "ESPDMX.h"
#include <ESPAsyncWebServer.h>
#include <SPIFFS.h>
// 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", "<html><body><h1>Hello, I'm a DMX-INTERFACE!</h1></body></html>"); });
request->send(SPIFFS, "/index.html"); });
server.begin();
Serial.println("Server started!");