local sever ota

This commit is contained in:
Mit4el
2024-11-26 23:30:16 +03:00
parent 247cb51169
commit d726e661c0
9 changed files with 47 additions and 25 deletions

View File

@@ -89,6 +89,8 @@ void standWebServerInit() {
// - second callback handles file upload at that location
HTTP.on("/edit", HTTP_POST, replyOK, handleFileUpload);
HTTP.on("/localota", HTTP_GET, handleLocalOTA);
// Default handler for all URIs not defined above
// Use it to read files from filesystem
HTTP.onNotFound(handleNotFound);
@@ -156,6 +158,10 @@ void handleStatus() {
HTTP.send(200, "application/json", json);
}
void handleLocalOTA() {
upgrade_firmware(3, "local");
}
#ifdef ESP32
String getContentType(String filename) {
if (HTTP.hasArg("download")) {