Simple API for the open sign controller
SIGN_LOGLEVEL
defaults todebug
SIGN_PORT
defaults to3000
SIGN_HOST
defaults to127.0.0.1
SIGN_CONTROLLER_SECRET
the secret used by the sign controller (should be a long random string)SIGN_STAFF_SECRET
the secret used by staff to manually control the sign (should be a long random string)
The API will live at isawthesign.allhandsactive.org
. Methods listed as public don't require auth. Methods listed as private require HTTP basic auth.
- GET /state - public, returns
true
/false
for power on/off - PUT /state - private, reports an update of the sign state to the API (meant to be used by the sign controller only). The update is passed as
true
for power on, andfalse
for power off. This should be called each time the power state changes, and periodically to keep the API in sync (once a minute or so). - GET /toggle - private, reports true/false (meant to be used by the sign controller only), once true is read, it goes back to false. This should be called periodically by the sign controller to check for a remote state change (once every 5 seconds or so).
- PUT /toggle - private, allows staff to submit a toggle request (only used by AHA staff, separate auth)
npm run build
- build and push the docker image - expects theDOCKER_PASS
environment variable to be a valid auth token forallhandsactive
npm run lint:fix
- fix various code formatting problems and report errorsnpm start
- start the development server and monitor for changesnpm test
- run the test suite