Add 404 to simple_web/explanation.md

This commit is contained in:
Leonie 2023-10-31 12:30:59 +01:00
parent 14f45ac86b
commit 6fa2b09851

View file

@ -5,6 +5,13 @@ AsyncWebServer server(80);
```
Start the Web Server on port 80
```
void notFound(AsyncWebServerRequest *request) {
request->send(404, "text/plain", "Not found");
}
```
This will handle requests on wrong uri's with this code `server.onNotFound(notFound);`
```
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {