compiling version

This commit is contained in:
Dmitry Borisenko
2021-12-13 00:58:16 +01:00
parent 2a79a5880f
commit 7486ba7438

View File

@@ -1,17 +1,14 @@
#include "WebServer.h"
#include "BufferExecute.h" #include "BufferExecute.h"
#include "FSEditor.h" #include "FSEditor.h"
#include "HttpServer.h"
#include "Utils/FileUtils.h" #include "Utils/FileUtils.h"
#include "Utils/WebUtils.h" #include "Utils/WebUtils.h"
AsyncWebSocket ws("/ws"); AsyncWebSocket ws("/ws");
AsyncEventSource events("/events"); AsyncEventSource events("/events");
namespace HttpServer {
/* Forward declaration */ void HttpServerinit() {
void initOta();
void initMDNS();
void init() {
String login = jsonReadStr(configSetupJson, "weblogin"); String login = jsonReadStr(configSetupJson, "weblogin");
String pass = jsonReadStr(configSetupJson, "webpass"); String pass = jsonReadStr(configSetupJson, "webpass");
#ifdef ESP32 #ifdef ESP32
@@ -77,7 +74,7 @@ void init() {
initOta(); initOta();
initMDNS(); initMDNS();
initWS(); HttpServerinitWS();
SerialPrint("I", F("HTTP"), F("HttpServer Init")); SerialPrint("I", F("HTTP"), F("HttpServer Init"));
} }
@@ -202,7 +199,7 @@ void initOta() {
#endif #endif
} }
void initWS() { void HttpServerinitWS() {
#ifdef WEBSOCKET_ENABLED #ifdef WEBSOCKET_ENABLED
ws.onEvent(onWsEvent); ws.onEvent(onWsEvent);
server.addHandler(&ws); server.addHandler(&ws);
@@ -212,5 +209,3 @@ void initWS() {
server.addHandler(&events); server.addHandler(&events);
#endif #endif
} }
} // namespace HttpServer