Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
745 B

  1. #include <ESP8266React.h>
  2. #include <DemoProject.h>
  3. #include <FS.h>
  4. #define SERIAL_BAUD_RATE 115200
  5. AsyncWebServer server(80);
  6. ESP8266React esp8266React(&server, &SPIFFS);
  7. DemoProject demoProject = DemoProject(&server, &SPIFFS, esp8266React.getSecurityManager());
  8. void setup() {
  9. // start serial and filesystem
  10. Serial.begin(SERIAL_BAUD_RATE);
  11. // start the file system (must be done before starting the framework)
  12. SPIFFS.begin();
  13. // start the framework and demo project
  14. esp8266React.begin();
  15. // start the demo project
  16. demoProject.begin();
  17. // start the server
  18. server.begin();
  19. }
  20. void loop() {
  21. // run the framework's loop function
  22. esp8266React.loop();
  23. // run the demo project's loop function
  24. demoProject.loop();
  25. }