simple serial monitor in httpserver
This commit is contained in:
@@ -1,12 +1,5 @@
|
||||
#include "filesys.h"
|
||||
|
||||
// listDir("/");
|
||||
// deleteFile("/hello.txt");
|
||||
// writeFile("/hello.txt", "Hello ");
|
||||
// appendFile("/hello.txt", "World!\n\r");
|
||||
// printFile("/hello.txt");
|
||||
// listDir("/");
|
||||
|
||||
FSInfo fsinfo;
|
||||
|
||||
bool mount_fs() {
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <LittleFS.h>
|
||||
|
||||
// some usefull wrappers for Filesystem
|
||||
|
||||
bool mount_fs();
|
||||
bool format_fs();
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
File f = open("/compress.html.gz");
|
||||
if (!f) {
|
||||
Serial.println("Failed to open file for reading");
|
||||
send(404, "text/plain", "Failed to open file for reading");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -50,7 +51,7 @@ public:
|
||||
File f = open("/comp.html.gz");
|
||||
if (!f) {
|
||||
Serial.println("Failed to open file for reading");
|
||||
|
||||
send(404, "text/plain", "Failed to open file for reading");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -58,7 +59,14 @@ public:
|
||||
const String cont = "text/html";
|
||||
streamFile(f, cont);
|
||||
}
|
||||
});
|
||||
|
||||
on("/terminal", [this]() {
|
||||
String log_msg = "terminal: millis: ";
|
||||
log_msg += millis();
|
||||
send(200, "text/plain", log_msg);
|
||||
});
|
||||
|
||||
onNotFound([this]() {
|
||||
String message = "File Not Found\n\n";
|
||||
message += "URI: ";
|
||||
|
||||
Reference in New Issue
Block a user