ESPWebServer
ESPWebServer copied to clipboard
How to remove the handlers to reuse the server
Have spent few hours trying to close() the server to begin () it again with new handlers but nothing works. I am adding handlers with server.on() Here is part of my code: ESP8266WebServer server(80); void setup() { server.on("/def", HTTP_GET, { server.send ( 200, "text/plain", "DefStillHere"); }); server.on("/test", HTTP_GET, { server.send ( 200, "text/plain", "StillAlive"); }); server.begin(); } SetMode("CONFIG_MODE"); void SetMode(String MODE) { //works? delay(200); if( MODE=="CONFIG_MODE"){ //set variables StartAP(); SetEndpoints(); } server.begin(); } P.S. just want to remove the handlers, so I wont have to check if they should be available.