Moved index.html from SPIFFS to program memory. Removed dependencies to SPIFFS. Also, we can use a different partition scheme with much more program space instead of reserving some of it for SPIFFS.

This commit is contained in:
2019-11-29 06:10:17 +01:00
parent dd9e1538c8
commit 8e15f87cd3
11 changed files with 23 additions and 61 deletions

View File

@@ -1,7 +1,7 @@
#include "http_server.h"
#include "main.h"
#include "spi_master.h"
#include <ESPmDNS.h>
#include <SPIFFS.h>
HTTPServer::HTTPServer(Player* p, Controller* c) {
_player = p;
@@ -12,7 +12,7 @@ HTTPServer::HTTPServer(Player* p, Controller* c) {
ws->onEvent([&](AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len){this->_onEvent(server, client, type, arg, data, len);});
_server->on("/", HTTP_GET, [&](AsyncWebServerRequest* req) {
req->send(SPIFFS, "/index.html", "text/html");
req->send(200, "text/html", (const char*)file_index_html_start);
});
_server->on("/upload", HTTP_POST, [](AsyncWebServerRequest* req) {
req->send(200);