mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-04-29 12:05:12 +00:00
add back NTP
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
static constexpr const char CACHE_CONTROL[] = "public,max-age=60";
|
static constexpr const char CACHE_CONTROL[] = "public,max-age=60";
|
||||||
|
|
||||||
// Single static-content handler serving all assets embedded in WWWData.h.
|
// Single static-content handler serving all assets embedded in WWWData.h
|
||||||
class StaticContentHandler : public AsyncWebHandler {
|
class StaticContentHandler : public AsyncWebHandler {
|
||||||
public:
|
public:
|
||||||
bool canHandle(AsyncWebServerRequest * request) const override {
|
bool canHandle(AsyncWebServerRequest * request) const override {
|
||||||
@@ -15,8 +15,7 @@ class StaticContentHandler : public AsyncWebHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handleRequest(AsyncWebServerRequest * request) override {
|
void handleRequest(AsyncWebServerRequest * request) override {
|
||||||
// OPTIONS is handled generically - the server-level CORS headers are
|
// OPTIONS is handled generically - the server-level CORS headers are attached via DefaultHeaders in ESP32React::begin().
|
||||||
// attached via DefaultHeaders in ESP32React::begin().
|
|
||||||
if (request->method() == HTTP_OPTIONS) {
|
if (request->method() == HTTP_OPTIONS) {
|
||||||
request->send(200);
|
request->send(200);
|
||||||
return;
|
return;
|
||||||
@@ -57,8 +56,7 @@ class StaticContentHandler : public AsyncWebHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns the /index.html asset, used as the SPA fallback for any GET
|
// Returns the /index.html asset, used as the SPA fallback for any GET
|
||||||
// that didn't match an embedded asset (React Router handles routing on
|
// that didn't match an embedded asset (React Router handles routing on the client side).
|
||||||
// the client side).
|
|
||||||
static const WWWAsset * index_asset() {
|
static const WWWAsset * index_asset() {
|
||||||
static const WWWAsset * cached = nullptr;
|
static const WWWAsset * cached = nullptr;
|
||||||
if (cached == nullptr) {
|
if (cached == nullptr) {
|
||||||
@@ -106,4 +104,5 @@ void ESP32React::loop() {
|
|||||||
_networkSettingsService.loop();
|
_networkSettingsService.loop();
|
||||||
_apSettingsService.loop();
|
_apSettingsService.loop();
|
||||||
_mqttSettingsService.loop();
|
_mqttSettingsService.loop();
|
||||||
|
_ntpSettingsService.loop();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user