Skip to content

Commit

Permalink
Fix heap display
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussy committed Mar 23, 2020
1 parent 581b508 commit 59a043b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void initWebServer() {

void setRegPageAliases() {
// Regular page aliases

server.serveStatic("/", SPIFFS, "/").setDefaultFile("index.htm");
server.serveStatic("/index.htm", SPIFFS, "/");
server.serveStatic("/about/", SPIFFS, "/").setDefaultFile("about.htm");
Expand All @@ -61,7 +62,9 @@ void setActionPageHandlers() {
// Action Page Handlers

server.on("/heap/", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", String(ESP.getFreeHeap()));
uint32_t _heap = ESP.getFreeHeap();
String heap = "Current heap: " + String(_heap);
request->send(200, F("text/plain"), heap);
});

server.on("/wifi2/", HTTP_GET, [] (AsyncWebServerRequest *request) {
Expand Down

0 comments on commit 59a043b

Please sign in to comment.