mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-07-05 05:38:54 +00:00
implemented reset of config
This commit is contained in:
parent
2ee16f6452
commit
8a3bd49686
5 changed files with 47 additions and 4 deletions
|
@ -84,6 +84,14 @@ void setup()
|
|||
server.on("/config", HTTP_GET, [](AsyncWebServerRequest *request)
|
||||
{ onGetConfig(config, request); });
|
||||
|
||||
server.on("/reset", HTTP_POST, [](AsyncWebServerRequest *request)
|
||||
{
|
||||
config.begin("dmx", false);
|
||||
config.clear();
|
||||
config.end();
|
||||
// respond with default config
|
||||
onGetConfig(config, request); });
|
||||
|
||||
server.onRequestBody([](AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total)
|
||||
{
|
||||
if (request->url() == "/config" && request->method() == HTTP_PUT) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue