This oehu-setup-api
repository exists of an internal API to setup OEHU.
The Raspberry Pi runs the API (see https://oehu.org/get-started to get started with OEHU).
Example function calls are:
- startReadWrite
- updateConfigValue
- getConfig
- newDeviceId
On 2018-10-15 the following end points were available:
/wifi/scan
/wifi/connect/:ssid/:password
/wifi/status
/wifi/disconnect
/oehu/getconfig
/oehu/generateNewPhrase
/oehu/getKeypair
/oehu/getConfigurated
/oehu/startEmulator
/oehu/stopEmulator
/oehu/isEmulating
/oehu/registerDevice/:deviceType/:lat/:long/:locationAccuracy/:householdType/:occupants
/oehu/start
/oehu/stop
/oehu/isRunning
See the following files for a working/updated list of API end points:
- https://github.com/OEHU/oehu-setup-api/blob/master/src/oehu/oehu.routes.js
- https://github.com/OEHU/oehu-setup-api/blob/master/src/wifi/wifi.routes.js
npm install
npm run dev
API server will listen on http://localhost:8000 & watch for changes to restart.
npm start
The tests are made with AVA, nyc and mono-test-utils in test/
:
npm test