Skip to content

Commit 2fa6e78

Browse files
author
Holger Pieta
committed
First configure webserver, then call begin()
According to the documentation of ESPAsyncWebServer, the server should be first configured and then started by calling begin().
1 parent 8e07cf9 commit 2fa6e78

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

WebServer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ WebServer::WebServer()
2828

2929
void WebServer::begin(Configuration &configuration) {
3030
SPIFFS.begin();
31-
server.begin();
32-
31+
3332
server.on("/" , HTTP_GET, [](AsyncWebServerRequest * request)
3433
{
3534
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", index_htm_gz, index_htm_gz_len);
@@ -133,6 +132,8 @@ void WebServer::begin(Configuration &configuration) {
133132
#endif
134133
request->send(404);
135134
});
135+
136+
server.begin();
136137
}
137138

138139
void WebServer::debugPrintRequest(AsyncWebServerRequest *request)

0 commit comments

Comments
 (0)