REST api to control LEDs on Rpi GPIO
npm install rpi-rest-leds
The default setup is for using 3 LEDs connected to GPIO #9,10,11, as used by the Pi Traffic Light board.
Go into the node-api folder to get to the code, and the raml-doc folder for RAML and Markdown documentation of the API.
#### requires:
- WiringPi
- node.js
- and npm, which is bundled with node.js
npm install inside this directory. That should install all needed dependencies as listed in package.json.Then to start the API server, run node server.js in this directory.
Or you can install with npm by running npm install -g rpi-rest-leds, then run the server with rpi-rest-leds in the command line.
The default port for accessing the server is 8080, so the base url is http://YOUR_RPI_IP:8080/node-api, of course replacing YOUR_RPI_IP with the IP address of your raspberry pi!
The LED control API would be at: http://YOUR_RPI_IP:8080/node-api/leds
For more documentation look in ../raml-doc folder.