notsunohito / express-gpio

A Nodejs Express based WebAPI server to turn on/off RPi GPIO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Express-GPIO

  • A Nodejs Express based WebAPI server to turn on/off RPi GPIO

Install on your RPi

$git clone http://github.com/notsunohito/express-gpio && cd express-gpio

$npm install --production

Start the server

$npm start

Usage

$curl --request GET http://{RPi's hostname}:3000/gpio/2/high

will turn on GPIO2

$curl --request GET http://{RPi's hostname}:3000/gpio/2/low

will turn off GPIO2

If you want to use an example GUI, Open http://{RPi's hostname}:3000/ with browser

*only supported for Rpi >= Rev2 at the moment

*only supported for HIGH or LOW at the moment

Develop

Install full packages:

$npm install

Install gulp globally:

$npm install --global gulp

Start the server with nodemon:

$gulp dev

Open another terminal then:

$gulp

will enable BrowserSync

About

A Nodejs Express based WebAPI server to turn on/off RPi GPIO


Languages

Language:JavaScript 79.0%Language:CSS 21.0%