lot/oldapp/pusher.js

27 lines
746 B
JavaScript
Raw Permalink Normal View History

2017-09-08 09:45:53 +00:00
/**
*
* User: Martin Donnelly
* Date: 2016-04-08
* Time: 16:35
*
*/
var Pushover = require('node-pushover')/*, dateFormat = require('dateformat')*/;
2017-09-08 09:45:53 +00:00
var push = new Pushover({
'token': 'aqnos2j4v4pjpry3hvnxq9646eup23',
'user': 'BE2vgFxdHJw91lVGMRYvZDDmVa5cCM'
});
const logger = require('log4js').getLogger();
2017-09-08 09:45:53 +00:00
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 }`;
2017-09-08 09:45:53 +00:00
push.send(title, msg);
}
};