mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
move 404 handler public, remove 404 info, add examples for overrides
This commit is contained in:
@@ -72,8 +72,12 @@ void saveParamCallback(){
|
||||
}
|
||||
|
||||
void bindServerCallback(){
|
||||
wm.server->on("/custom",handleRoute); // this is now crashing esp32 for some reason
|
||||
// wm.server->on("/info",handleRoute); // you can override wm!
|
||||
wm.server->on("/custom",handleRoute);
|
||||
|
||||
// you can override wm route endpoints, I have not found a way to remove handlers, but this would let you disable them or add auth etc.
|
||||
// wm.server->on("/info",handleNotFound);
|
||||
// wm.server->on("/update",handleNotFound);
|
||||
wm.server->on("/erase",handleNotFound);
|
||||
}
|
||||
|
||||
void handleRoute(){
|
||||
@@ -81,6 +85,11 @@ void handleRoute(){
|
||||
wm.server->send(200, "text/plain", "hello from user code");
|
||||
}
|
||||
|
||||
void handleNotFound(){
|
||||
Serial.println("[HTTP] handle route");
|
||||
wm.handleNotFound();
|
||||
}
|
||||
|
||||
void handlePreOtaUpdateCallback(){
|
||||
Update.onProgress([](unsigned int progress, unsigned int total) {
|
||||
Serial.printf("CUSTOM Progress: %u%%\r", (progress / (total / 100)));
|
||||
|
||||
Reference in New Issue
Block a user