You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change all class components to FCs
Use hooks throughout
Replace react-material-ui-form-validator with async-validator
Upgrade UI dependencies
Use dev proxy instead of CORS for local development
Use AXIOS instead of fetch
Copy file name to clipboardExpand all lines: README.md
+7-20
Original file line number
Diff line number
Diff line change
@@ -118,37 +118,24 @@ UI development is an iterative process so it's best to run a development server
118
118
119
119
The following steps can get you up and running for local interface development:
120
120
121
-
-[Enable CORS](#enabling-cors) in platformio.ini
122
121
- Deploy firmware to device
123
-
-[Configure endpoint root](#configuring-the-endpoint-root) with device's IP in interface/.env.development
122
+
-[Configuring the dev proxy](#configuring-the-dev-proxy) with device's IP in interface/package.json
124
123
-[Start the development server](#starting-the-development-server) with "npm start"
125
124
- Develop interface locally
126
125
127
-
#### Enabling CORS
126
+
#### Configuring the dev proxy
128
127
129
-
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:
128
+
The interface has a development environment which is enabled when running the development server using `npm start`. The [package.json](interface/package.json) file defines the location of the services which the development server will proxy. This is defined by the "proxy" propery, which will need to be change to the the IP address or hostname of the device running the firmware.
130
129
131
-
```ini
132
-
-D ENABLE_CORS
133
-
-D CORS_ORIGIN=\"http://localhost:3000\"
134
-
```
135
-
136
-
#### Configuring the endpoint root
137
-
138
-
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:
139
-
140
-
```ini
141
-
REACT_APP_HTTP_ROOT=http://192.168.0.99
142
-
REACT_APP_WEB_SOCKET_ROOT=ws://192.168.0.99
130
+
```json
131
+
"proxy": "http://192.168.0.77"
143
132
```
144
133
145
-
The `REACT_APP_HTTP_ROOT` and `REACT_APP_WEB_SOCKET_ROOT` properties can be modified to point a ESP device running the back end.
146
-
147
-
> **Tip**: You must restart the development server for changes to the environment file to come into effect.
134
+
> **Tip**: You must restart the development server for changes to the proxy location to come into effect. Note that the proxy is configured to handle http and WebSocket connections from this location, see [setupProxy.js](interface/src/setupProxy.js) for details.
148
135
149
136
#### Starting the development server
150
137
151
-
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:
138
+
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:
0 commit comments