How to use the node-red/red/red.js.init function in node-red

To help you get started, we’ve selected a few node-red examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BiancoRoyal / node-red-contrib-modbus / src / testing / nodered-helper.js View on Github external
startServer: function (done) {
    server = http.createServer(function (req, res) {
      app(req, res)
    })
    RED.init(server, {
      SKIP_BUILD_CHECK: true,
      logging: {console: {level: 'off'}}
    })
    server.listen(listenPort, address)
    server.on('listening', function () {
      port = server.address().port
      url = 'http://' + address + ':' + port
      comms.start()
      done()
    })
  },
    // TODO consider saving TCP handshake/server reinit on start/stop/start sequences