use built in method for default index file

pull/1/head
Thomas Ballmann 4 years ago
parent 4ff72d2120
commit e5a382653f

@ -20,14 +20,10 @@ void setupApp()
// @see https://github.com/me-no-dev/ESPAsyncWebServer
// DirectoryIndex Directive
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send(SPIFFS, "/dist/index.html", "text/html");
});
// serve static files
server
.serveStatic("/", SPIFFS, "/dist/")
.setDefaultFile("index.html")
.setCacheControl("max-age=600")
;

Loading…
Cancel
Save