Skip to content

Commit c33479a

Browse files
committed
add documentation
1 parent 27e049b commit c33479a

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ You can configure the project to serve the interface from PROGMEM by uncommentin
9898

9999
Be aware that this will consume ~150k of program space which can be especially problematic if you already have a large build artefact or if you have added large javascript dependencies to the interface. The ESP32 binaries are large already, so this will be a problem if you are using one of these devices and require this type of setup.
100100

101-
A method for working around this issue can be to reduce the amount of space allocated to SPIFFS by configuring the device to use a differnt strategy partitioning. If you don't require SPIFFS other than for storing config one approach might be to configure a minimal SPIFFS partition.
101+
A method for working around this issue can be to reduce the amount of space allocated to SPIFFS by configuring the device to use differnt partitioning. If you don't require SPIFFS other than for storing config one approach might be to configure a minimal SPIFFS partition.
102102

103103
For a ESP32 (4mb variant) there is a handy "min_spiffs.csv" partition table which can be enabled easily:
104104

@@ -113,7 +113,7 @@ This is left as an exersise for the reader as everyone's requirements will vary.
113113

114114
### Running the interface locally
115115

116-
You can run a local development server to allow you preview changes to the front end without the need to upload a file system image to the device after each change.
116+
You can run a local development server to allow you preview changes to the front end without the need to upload a file system image to the device after each change.
117117

118118
Change to the ['interface'](interface) directory with your bash shell (or Git Bash) and use the standard commands you would with any react app built with create-react-app:
119119

@@ -132,12 +132,17 @@ npm start
132132
133133
#### Changing the endpoint root
134134

135-
The endpoint root path can be found in ['interface/.env.development'](interface/.env.development), defined as the environment variable 'REACT_APP_ENDPOINT_ROOT'. This needs to be the root URL of the device running the back end, for example:
135+
The interface has a development environment which is enabled when running the development server using `npm start`. The environment file can be found in ['interface/.env.development'](interface/.env.development) and contains the HTTP root URL and the WebSocket root URL:
136136

137-
```js
138-
REACT_APP_ENDPOINT_ROOT=http://192.168.0.6/rest/
137+
```properties
138+
REACT_APP_HTTP_ROOT=http://192.168.0.99
139+
REACT_APP_WEB_SOCKET_ROOT=ws://192.168.0.99
139140
```
140141

142+
The `REACT_APP_HTTP_ROOT` and `REACT_APP_WEB_SOCKET_ROOT` properties can be modified to point a ESP device running the back end firmware.
143+
144+
> **Note**: You must restart the development server for changes to the environment to become effective.
145+
141146
#### Enabling CORS
142147

143148
You can enable CORS on the back end by uncommenting the -D ENABLE_CORS build flag in ['platformio.ini'](platformio.ini) then re-building and uploading the firmware to the device. The default settings assume you will be accessing the development server on the default port on [http://localhost:3000](http://localhost:3000) this can also be changed if required:
@@ -254,7 +259,7 @@ You can replace the app icon is located at ['interface/public/app/icon.png'](int
254259

255260
The app name displayed on the login page and on the menu bar can be modified by editing the REACT_APP_NAME property in ['interface/.env'](interface/.env)
256261

257-
```js
262+
```properties
258263
REACT_APP_NAME=Funky IoT Project
259264
```
260265

media/framework.png

-49 KB
Loading

0 commit comments

Comments
 (0)