Skip to content

Commit d0fb2d9

Browse files
committed
update readme with changes to the demo code
1 parent 41f7579 commit d0fb2d9

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ The following code creates the web server, esp8266React framework and the demo p
262262

263263
```cpp
264264
AsyncWebServer server(80);
265-
ESP8266React framework(&SPIFFS);
266-
DemoProject demoProject = DemoProject(&SPIFFS, framework.getSecurityManager());
265+
ESP8266React esp8266React(&server, &SPIFFS);
266+
DemoProject demoProject = DemoProject(&server, &SPIFFS, esp8266React.getSecurityManager());
267267
```
268268
269269
Now in the `setup()` function the initialization is performed:
@@ -272,14 +272,16 @@ Now in the `setup()` function the initialization is performed:
272272
void setup() {
273273
// start serial and filesystem
274274
Serial.begin(SERIAL_BAUD_RATE);
275+
276+
// start the file system (must be done before starting the framework)
275277
SPIFFS.begin();
276278
277-
// set up the framework
278-
framework.init(&server);
279+
// start the framework and demo project
280+
esp8266React.begin();
281+
282+
// start the demo project
283+
demoProject.begin();
279284
280-
// begin the demo project
281-
demoProject.init(&server);
282-
283285
// start the server
284286
server.begin();
285287
}
@@ -290,7 +292,7 @@ Finally the loop calls the framework's loop function to service the frameworks f
290292
```cpp
291293
void loop() {
292294
// run the framework's loop function
293-
framework.loop();
295+
esp8266React.loop();
294296

295297
// run the demo project's loop function
296298
demoProject.loop();

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ void setup() {
1717

1818
// start the framework and demo project
1919
esp8266React.begin();
20+
21+
// start the demo project
2022
demoProject.begin();
2123

2224
// start the server

0 commit comments

Comments
 (0)