Improve formatting and Spelling

This commit is contained in:
Leonie 2023-10-31 12:09:50 +01:00
parent 5381a6b32d
commit abc10ff02e

View file

@ -12,16 +12,16 @@ WiFi.begin(ssid, password);
return; return;
} }
``` ```
Start the WIFI with `WiFi.begin(ssid, password);` and wait for connection Start the WIFI with `WiFi.begin(ssid, password);` and wait for connection.
``` ```
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){ server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send(200, "text/html", "<a href=\"/on\">Turn the LED ON</a><a href=\"/off\">Turn the LED OFF</a>"); request->send(200, "text/html", "<a href=\"/on\">Turn the LED ON</a><a href=\"/off\">Turn the LED OFF</a>");
}); });
``` ```
`server.on` Defines an Endpoint for a request (e.g /index.html) `server.on` Defines an endpoint for a request (e.g /index.html)
`request->send(200, "text/html", "<button onclick=\"fetch('http://192.168.178.198/on')\">Turn LED ON</button> <button onclick=\"fetch('http://192.168.178.198/off')\">Turn LED OFF</button>");` on Request answer with 200 in the format text/html with this string `request->send([..]"<button onclick=\"fetch('http://192.168.178.198/on')\">Turn LED ON</button>[..]");` on Request answer with 200 in the format text/html with this string
``` ```
server.on("/on", HTTP_GET, [](AsyncWebServerRequest *request){ server.on("/on", HTTP_GET, [](AsyncWebServerRequest *request){