updated doc

This commit is contained in:
proddy
2021-05-14 12:45:19 +02:00
parent ab28013ec6
commit 42a362196e

View File

@@ -1,9 +1,10 @@
(https://github.com/emsesp/EMS-ESP32/issues/41)
(<https://github.com/emsesp/EMS-ESP32/issues/41>)
When developing and testing the web interface, it's handy not to bother with re-flashing an ESP32 each time. The idea is to mimic the ESP using a mock/stub server that responds to the REST (HTTP POST & GET) and WebSocket calls.
When developing and testing the web interface, it's handy not to bother with re-flashing an ESP32 each time. The idea is to mimic the ESP using a mock/stub server that responds to the REST (HTTP POST & GET) and WebSocket calls.
To set it up it do
```sh
% cd mock-api
% npm install
@@ -12,6 +13,7 @@ To set it up it do
```
and to run it
```sh
% cd interface
% npm run dev
@@ -19,11 +21,9 @@ and to run it
## Notes
- It's for local development only
- `src/.env.development` is no longer required
- CORS is removed, also the build flag
- new file `interface/src/setupProxy.js`
- new files `mock-api/server.js` with the hardcoded data. Requires its own npm packages for express
## ToDo
- add filter rule to prevent from exposing yourself to malicious attacks when running the dev server(https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a)
- add filter rule to prevent from exposing yourself to malicious attacks when running the dev server(<https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a>)