mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2025-08-02 20:24:40 +02:00
update sample
This commit is contained in:
@@ -183,6 +183,20 @@ void setup() {
|
||||
|
||||
Serial.begin(115200);
|
||||
|
||||
#ifndef CONFIG_IDF_TARGET_ESP32H2
|
||||
// WiFi.mode(WIFI_STA);
|
||||
// WiFi.begin("YOUR_SSID", "YOUR_PASSWORD");
|
||||
// if (WiFi.waitForConnectResult() != WL_CONNECTED) {
|
||||
// Serial.printf("WiFi Failed!\n");
|
||||
// return;
|
||||
// }
|
||||
// Serial.print("IP Address: ");
|
||||
// Serial.println(WiFi.localIP());
|
||||
|
||||
WiFi.mode(WIFI_AP);
|
||||
WiFi.softAP("esp-captive");
|
||||
#endif
|
||||
|
||||
#ifdef ESP32
|
||||
LittleFS.begin(true);
|
||||
#else
|
||||
@@ -201,20 +215,6 @@ void setup() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_IDF_TARGET_ESP32H2
|
||||
// WiFi.mode(WIFI_STA);
|
||||
// WiFi.begin("YOUR_SSID", "YOUR_PASSWORD");
|
||||
// if (WiFi.waitForConnectResult() != WL_CONNECTED) {
|
||||
// Serial.printf("WiFi Failed!\n");
|
||||
// return;
|
||||
// }
|
||||
// Serial.print("IP Address: ");
|
||||
// Serial.println(WiFi.localIP());
|
||||
|
||||
WiFi.mode(WIFI_AP);
|
||||
WiFi.softAP("esp-captive");
|
||||
#endif
|
||||
|
||||
// curl -v -X GET http://192.168.4.1/handler-not-sending-response
|
||||
server.on("/handler-not-sending-response", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
// handler forgot to send a response to the client => 501 Not Implemented
|
||||
@@ -389,9 +389,8 @@ void setup() {
|
||||
request->send(200, "text/html", htmlContent);
|
||||
});
|
||||
|
||||
server.on("/file", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
request->send(LittleFS, "/index.txt");
|
||||
});
|
||||
// curl -v -X GET http://192.168.4.1/index.txt
|
||||
server.serveStatic("/index.txt", LittleFS, "/index.txt");
|
||||
|
||||
// Issue #14: assert failed: tcp_update_rcv_ann_wnd (needs help to test fix)
|
||||
// > curl -v http://192.168.4.1/issue-14
|
||||
|
@@ -2,10 +2,10 @@
|
||||
default_envs = arduino-2, arduino-3, arduino-310rc1, esp8266, raspberrypi
|
||||
lib_dir = .
|
||||
; src_dir = examples/CaptivePortal
|
||||
; src_dir = examples/SimpleServer
|
||||
src_dir = examples/SimpleServer
|
||||
; src_dir = examples/StreamFiles
|
||||
; src_dir = examples/Filters
|
||||
src_dir = examples/Issue85
|
||||
; src_dir = examples/Issue85
|
||||
|
||||
[env]
|
||||
framework = arduino
|
||||
|
Reference in New Issue
Block a user