   WiFi.disconnect();
 }
 
-void saveConfigAndRestart()
+void saveConfig()
 {
   EEPROM.begin(1);
   EEPROM.write(0, (int)BootMode::Sensor);


void handleIndex()
{
  FlashStream htmlStream((PGM_P)html);
  webServer.streamFile(htmlStream, "text/html");
}

void validateWiFiConfig()

  webServer.on("/", HTTP_GET, handleIndex);
  webServer.on("/wifi/config", HTTP_POST, validateWiFiConfig);
  webServer.on("/wifi/status", HTTP_POST, getWiFiStatus);
  webServer.on("/restart", HTTP_POST, [](){
    webServer.send(200, "text/plain", "OK.");
    delay(1000);
    ESP.restart();
  });
  webServer.begin();

  Serial.println("Configuration setup done.");
}

void configurationLoop() {
  measure("DNS", []() { dnsServer.processNextRequest(); });
  measure("Web", []() { webServer.handleClient(); });
}
