No Description

relay_controller.js 564B

    var logger = require('winston'); var relay_status = [ 1, 1, 1, 1] module.exports.start = function(router, channel){ logger.info("Starting Relay controller module"); router.post('/switch_relay', function (req, res) { logger.info("Received request for switching relays", req.body); channel.emit('news', { hello: 'again' }); res.sendStatus(200); }); } module.exports.monitor = function(socket, channel){ channel.emit('news', { hello: 'world' }); socket.on('my other event', function (data) { logger.info("Receiveid data", data); }); }