Add 404 to simple_web/explanation.md
This commit is contained in:
parent
14f45ac86b
commit
6fa2b09851
|
@ -5,6 +5,13 @@ AsyncWebServer server(80);
|
||||||
```
|
```
|
||||||
Start the Web Server on port 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);
|
WiFi.begin(ssid, password);
|
||||||
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
|
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
|
||||||
|
|
Loading…
Reference in a new issue