mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
replace express with itty router - its 2x faster
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
(Based on <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 use first make sure you have nodejs installed (>v18) then install yarn (`npm install -g yarn`). Now type `yarn` from this `mock-api` folder. To run EMS-ESP's WebUI navigate up to the `interface` folder and type `yarn standalone`. This will start the mock API server on port 3080 using static dummy data from `mock-api/server.js` and also the web server which is at <http://localhost:3000>.
|
||||
# prerequisites
|
||||
|
||||
- Install the latest LTS of NodeJS
|
||||
- Install yarn (`npm install -g yarn`)
|
||||
- Install bun (<https://bun.sh/docs/installation>)
|
||||
- type `yarn` from this `mock-api` folder to build
|
||||
|
||||
# To run
|
||||
|
||||
- `yarn standalone` from the main `interface` folder and then navigate to <http://localhost:3000>
|
||||
|
||||
Reference in New Issue
Block a user