Skip to content

How to remove the handlers to reuse the server #4

@RazgrizX

Description

@RazgrizX

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions