https://github.com/rcasto/express-request-activity
Turn light on/off based off of request activity, built targeting Raspberry Pi.
https://github.com/rcasto/express-request-activity
express-middleware expressjs gpio raspberry-pi
Last synced: 5 months ago
JSON representation
Turn light on/off based off of request activity, built targeting Raspberry Pi.
- Host: GitHub
- URL: https://github.com/rcasto/express-request-activity
- Owner: rcasto
- License: mit
- Created: 2020-05-25T16:18:15.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T21:45:23.000Z (over 3 years ago)
- Last Synced: 2025-07-17T11:36:07.898Z (12 months ago)
- Topics: express-middleware, expressjs, gpio, raspberry-pi
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# express-request-activity
Turn light on/off based off of request activity, built targeting Raspberry Pi.
## How to use
Install the npm package:
```
npm install express-request-activity
```
Require and use the middleware:
```javascript
const express = require('express');
// Requiring the middleware
const requestActivity = require('express-request-activity');
// This might be slightly different for you
// but incorporation into your express app
// should be similar
const app = express();
// Using the middleware
app.use(requestActivity({
// The physical pin on the raspberry pi the
// light is connected to
lightPin: 11,
// The amount of time in milliseconds you want
// the light to stay on before turning off on request
// activity
lightOnTimeInMs: 500
}));
// The rest of your code...
```