1#include <WiFi.h>
2#include <ESPAsyncWebServer.h>
3
4const char* ssid = "ELDRADO";
5const char* password = "amazon123";
6
7AsyncWebServer server(80);
8
9void setup() {
10 Serial.begin(9600);
11
12
13 WiFi.begin(ssid, password);
14 while (WiFi.status() != WL_CONNECTED) {
15 delay(1000);
16 Serial.println("Connecting to WiFi...");
17 }
18 Serial.println("Connected to WiFi");
19
20
21 Serial.print("ESP32 Web Server's IP address: ");
22 Serial.println(WiFi.localIP());
23
24
25 server.on("/", HTTP_GET, [](AsyncWebServerRequest* request) {
26 Serial.println("ESP32 Web Server: New request received:");
27 Serial.println("GET /");
28 request->send(200, "text/html", "<html><body><h1>Hello, ESP32!</h1></body></html>");
29 });
30
31
32 server.begin();
33}
34
35void loop() {}