Files
EMS-ESP32/mock-api
2021-06-12 12:41:06 +02:00
..
2021-05-14 12:44:02 +02:00
2021-06-12 12:41:06 +02:00
2021-06-07 21:19:52 +02:00
2021-05-14 12:45:19 +02:00
2021-06-07 21:19:52 +02:00

(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.

To set it up it do

% cd mock-api
% npm install
% cd interface
% npm install

and to run it

% cd interface
% npm run dev

Notes

  • new file interface/src/setupProxy.js
  • new files mock-api/server.js with the hardcoded data. Requires its own npm packages for express

ToDo