Simple API for the open sign controller
SIGN_LOGLEVELdefaults todebugSIGN_PORTdefaults to3000SIGN_HOSTdefaults to127.0.0.1SIGN_CONTROLLER_SECRETthe secret used by the sign controller (should be a long random string)SIGN_STAFF_SECRETthe 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/falsefor 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
truefor power on, andfalsefor 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_PASSenvironment variable to be a valid auth token forallhandsactivenpm 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