2019-07-14 21:13:26 +00:00
|
|
|
#include <ESP8266React.h>
|
|
|
|
#include <DemoProject.h>
|
2018-11-11 16:44:29 +00:00
|
|
|
#include <FS.h>
|
2018-02-26 00:11:31 +00:00
|
|
|
|
|
|
|
#define SERIAL_BAUD_RATE 115200
|
|
|
|
|
|
|
|
AsyncWebServer server(80);
|
2019-09-30 20:28:24 +00:00
|
|
|
ESP8266React esp8266React(&server, &SPIFFS);
|
|
|
|
DemoProject demoProject = DemoProject(&server, &SPIFFS, esp8266React.getSecurityManager());
|
2018-02-26 00:11:31 +00:00
|
|
|
|
|
|
|
void setup() {
|
2019-08-09 14:53:39 +00:00
|
|
|
// start serial and filesystem
|
2019-06-07 19:08:46 +00:00
|
|
|
Serial.begin(SERIAL_BAUD_RATE);
|
2019-09-30 20:28:24 +00:00
|
|
|
|
|
|
|
// start the file system (must be done before starting the framework)
|
2019-06-07 19:08:46 +00:00
|
|
|
SPIFFS.begin();
|
2019-09-30 20:28:24 +00:00
|
|
|
|
|
|
|
// start the framework and demo project
|
|
|
|
esp8266React.begin();
|
2019-09-30 20:38:44 +00:00
|
|
|
|
|
|
|
// start the demo project
|
2019-09-30 20:28:24 +00:00
|
|
|
demoProject.begin();
|
|
|
|
|
2019-08-09 14:53:39 +00:00
|
|
|
// start the server
|
2019-06-07 19:08:46 +00:00
|
|
|
server.begin();
|
2018-02-26 00:11:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
2019-08-09 14:53:39 +00:00
|
|
|
// run the framework's loop function
|
2019-09-30 20:28:24 +00:00
|
|
|
esp8266React.loop();
|
2019-07-14 21:13:26 +00:00
|
|
|
|
2019-08-09 14:53:39 +00:00
|
|
|
// run the demo project's loop function
|
2019-07-14 21:13:26 +00:00
|
|
|
demoProject.loop();
|
2018-02-26 00:11:31 +00:00
|
|
|
}
|