Adafruit-WebIDE/helpers/websocket_helper.js
2018-02-16 13:37:10 -06:00

8 lines
205 B
JavaScript

var config = require('../config/config');
exports.send_message = function send_message(ws, type, data) {
if (!ws) {
ws = config.editor_ws;
}
ws.send(JSON.stringify({type: type, data: data}));
}