lot/oldapp/pusher.js
2022-05-12 16:33:35 +01:00

27 lines
746 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'
});
const 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 }`;
var msg = `Updated at ${ now.format(('dddd, mmmm dS, yyyy, HH:MM')) }\n\n${ contents }`;
push.send(title, msg);
}
};