PAW is a Slack-integrated tracking system for dogs in the workplace. It allows owners to effortlessly keep tabs of their pets without needing to have them tethered to a desk all day.
First, start a Redis server for storing data.
Then, to start the API server:
npm run start
or to start the API server with Nodemon + a client with Browsersync server:
npm run dev
or to build, cachebust, and minify all assets for production:
npm run build
Finally, send external events to the /api/event
endpoint. The payload should be formatted as:
{
events: [
{
device: String,
location: String,
time: Date
},
...
]
}
Application config lives in config.js
and uses nconf.
The same configuration is shipped with Node and the browser.
In Node, require the file then use nconf to get a config value by name:
var config = require('./config');
var TOKEN = config.get('ISL_API_TOKEN');
In Browserify, we load the nconf configuration with envify. Refer to your config value through process.env
:
setInterval(function() {
fetch();
}, process.env.DOG_POLLING_INTERVAL_MS);