lot/pusher.js
2017-09-08 10:45:53 +01:00

27 lines
645 B
JavaScript

/**
*
* User: Martin Donnelly
* Date: 2016-04-08
* Time: 16:35
*
*/
var Pushover = require('node-pushover'), dateFormat = require('dateformat');
var push = new Pushover({
'token': 'aqnos2j4v4pjpry3hvnxq9646eup23',
'user': 'BE2vgFxdHJw91lVGMRYvZDDmVa5cCM'
});
var logger = require('log4js').getLogger();
const prefix = process.env.NODE_ENV === 'production' ? 'Production' : 'Dev';
const title = `mdLot ${ prefix } Alert`;
module.exports = {
'push' : function(contents) {
var now = new Date();
var msg = `Updated at ${ dateFormat(now, 'dddd, mmmm dS, yyyy, HH:MM:ss') }\n\n${ contents }`;
push.send(title, msg);
}
};