Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to remove the handlers to reuse the server #4

Open
RazgrizX opened this issue Feb 20, 2018 · 0 comments
Open

How to remove the handlers to reuse the server #4

RazgrizX opened this issue Feb 20, 2018 · 0 comments

Comments

@RazgrizX
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant