• instead of a switch statement and parsing route, you can also just send functions as strings and have them be evaluated by the esp unit like so. (U can also use the eval function for this)

    ws.on('message', function(msg) {
      console.log(msg);
      var command = new Function(msg);
      command();
      });
    
    
About

Avatar for Esper @Esper started