mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2026-03-28 20:17:11 +01:00
Fixed 404 error when pressing refresh in webapp
This commit is contained in:
@@ -22,6 +22,12 @@ void WebApiWebappClass::init(AsyncWebServer* server)
|
||||
request->send(response);
|
||||
});
|
||||
|
||||
_server->onNotFound([](AsyncWebServerRequest* request) {
|
||||
AsyncWebServerResponse* response = request->beginResponse_P(200, "text/html", file_index_html_start, file_index_html_end - file_index_html_start);
|
||||
response->addHeader("Content-Encoding", "gzip");
|
||||
request->send(response);
|
||||
});
|
||||
|
||||
_server->on("/index.html", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
AsyncWebServerResponse* response = request->beginResponse_P(200, "text/html", file_index_html_start, file_index_html_end - file_index_html_start);
|
||||
response->addHeader("Content-Encoding", "gzip");
|
||||
|
||||
Reference in New Issue
Block a user