From 4fd4e56f6266b279bf8fcc6fe489dc98a0614889 Mon Sep 17 00:00:00 2001
From: Aadi Desai <21363892+supleed2@users.noreply.github.com>
Date: Mon, 14 Jun 2021 20:27:49 +0100
Subject: [PATCH] Add command.js to webserver serve code
---
Control/data/index.html | 6 +++---
Control/src/main.cpp | 6 ++++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Control/data/index.html b/Control/data/index.html
index f83a83c..12f4278 100644
--- a/Control/data/index.html
+++ b/Control/data/index.html
@@ -130,9 +130,9 @@
- |
- |
- |
+ |
+ |
+ |
|
diff --git a/Control/src/main.cpp b/Control/src/main.cpp
index aa24669..fdc00c4 100644
--- a/Control/src/main.cpp
+++ b/Control/src/main.cpp
@@ -111,15 +111,17 @@ void setup()
{
delay(500);
}
- while (!MDNS.begin("rover")) // Set up mDNS cast at "rover.local/"
+ while (!MDNS.begin("rover2")) // Set up mDNS cast at "rover.local/"
{
Serial.println("Error setting up mDNS, retrying in 5s");
delay(5000);
}
- Serial.println("mDNS set up, access Control Panel at 'rover.local/'");
+ Serial.println("mDNS set up, access Control Panel at 'rover2.local/'");
webserver.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{ request->send(SPIFFS, "/index.html", "text/html"); }); // Serve "index.html" at root page
+ webserver.on("/command.js", HTTP_GET, [](AsyncWebServerRequest *request)
+ { request->send(SPIFFS, "/command.js", "text/js"); }); // Serve "command.js" for root page to accessj
webserver.on("/favicon.ico", HTTP_GET, [](AsyncWebServerRequest *request)
{ request->send(SPIFFS, "/favicon.ico", "image/png"); }); // Serve tab icon
webserver.onNotFound(notFound); // Set up basic 404NotFound page