Skip to content
Permalink
Browse files

Send commands via HTTP GET

  • Loading branch information
spacehuhn committed Jan 26, 2020
1 parent 7eb0591 commit a8799b8feafd128c3986738665985a332f9a157b
Showing with 14 additions and 0 deletions.
  1. +14 −0 esp_duck/webserver.cpp
@@ -95,6 +95,20 @@ namespace webserver {
request->redirect("/error404.html");
});

server.on("/run", [](AsyncWebServerRequest* request) {
String message;

if (request->hasParam("cmd")) {
message = request->getParam("cmd")->value();
}

request->send(200, "text/plain", "Run: " + message);

cli::parse(message.c_str(), [](const char* str) {
debugf("%s\n", str);
}, false);
});

WEBSERVER_CALLBACK;

// Arduino OTA Update

0 comments on commit a8799b8

Please sign in to comment.
You can’t perform that action at this time.