mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2025-08-07 06:34:39 +02:00
update example
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <LittleFS.h>
|
||||
|
||||
const char* htmlContent = R"(
|
||||
const char* htmlContent PROGMEM = R"(
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -87,6 +87,8 @@ const char* htmlContent = R"(
|
||||
</html>
|
||||
)";
|
||||
|
||||
const size_t htmlContentLen = strlen_P(htmlContent);
|
||||
|
||||
AsyncWebServer server(80);
|
||||
AsyncEventSource events("/events");
|
||||
AsyncWebSocket ws("/ws");
|
||||
@@ -386,7 +388,7 @@ void setup() {
|
||||
// > brew install autocannon
|
||||
// > autocannon -c 10 -w 10 -d 20 http://192.168.4.1
|
||||
server.on("/", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
request->send(200, "text/html", htmlContent);
|
||||
request->send(200, "text/html", (uint8_t*)htmlContent, htmlContentLen);
|
||||
});
|
||||
|
||||
server.on("/file", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
|
Reference in New Issue
Block a user