-
Notifications
You must be signed in to change notification settings - Fork 113
make serveProgmem public, remove server.onNotFound(serveProgmem) from begin - compatibility Espalexa #119
Conversation
…server.onNotFound so it can be handled by main code
Removing the call from webServer.cpp in this pull request is of course problematic, since this will break loading the default GUI of the framework ;). I am not sure if I completely understand what you are trying to do... |
Guessing Zenon wants framework extended to allow users to optionally configure requests (not handled by espframework dashboard web) to be handled by callbacks in their main code. Enabling Zenon in this case to integrate with ESPAlexa |
Using it for more than a month now, works as it should. |
Exactly that. |
yes, but you have this code: 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);
}
}); which is not part of the pull request and re-implements the deleted functionality. If you would remove this, and try purely with the framework it will not work. so another mechanism is needed to tie into the onNotFound function while keeping existing functionality inside of the framework. |
You are right, Examples won't work unless the requests are forwarded using GUI.serveProgmem(request); from the main code. |
Sorry for the long delay. I have implemented this functionality in another way in the commit above, which will be part of the next release. The documentation is updated accordingly. |
Hi,
Could you please take a look?
My intention is to make the serveProgrem public so when another service is also running on the same port you can handle and filter requests on your main code.
In the specific case of Espalexa [https://github.com/Aircoookie/Espalexa.git]:
The library offers a check to determine if the request is for the Espalexa
after the changes I proposed this can also be handled with esp8266-iot-framework like so:
Take a look and see if my changes serve the purpose.
Regards,
Zenon