diff --git a/README.md b/README.md index c62fa4f..5d24c58 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ +*fork of the ESP8266 IoT Framework by maakbaas with small change to allow Espalexa[https://github.com/Aircoookie/Espalexa.git] integration.* + +## Using the changes + +You can now initialise the onNotFound within your main code like below and also check if the incoming requests are for the Espalexa. + +```ini +GUI.server.onNotFound([](AsyncWebServerRequest *request) + { + if (!espalexa.handleAlexaApiCall(request)) //if you don't know the URI, ask espalexa whether it is an Alexa control request + { + GUI.serveProgmem(request); + } + }); +``` # ESP8266 IoT Framework ![Status](https://travis-ci.com/maakbaas/esp8266-iot-framework.svg?branch=master) The ESP8266 IoT Framework is a set of modules to be used as a starting point in new ESP8266 projects, implementing HTTPS requests, a React web interface, WiFi manager, configuration manager, live dashboard and OTA updates. diff --git a/src/webServer.cpp b/src/webServer.cpp index 89582a7..234c52c 100644 --- a/src/webServer.cpp +++ b/src/webServer.cpp @@ -21,7 +21,7 @@ void webServer::begin() server.serveStatic("/download", LittleFS, "/"); - server.onNotFound(serveProgmem); + // server.onNotFound(serveProgmem); //handle uploads server.on(PSTR("/upload"), HTTP_POST, [](AsyncWebServerRequest *request) {}, handleFileUpload); diff --git a/src/webServer.h b/src/webServer.h index 170cbe9..7c7f5b7 100644 --- a/src/webServer.h +++ b/src/webServer.h @@ -8,12 +8,13 @@ class webServer private: static void handleFileUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final); - static void serveProgmem(AsyncWebServerRequest *request); + // static void serveProgmem(AsyncWebServerRequest *request); void bindAll(); public: AsyncWebServer server = AsyncWebServer(80); AsyncWebSocket ws = AsyncWebSocket("/ws"); + static void serveProgmem(AsyncWebServerRequest *request); void begin(); };