How to send data down to a board

Hi guys, I’m working on a small project and need to send data back and forth to an electron and a node server. I can use a webhook to send data from electron to server but how would I send data the other way around, sending from node server to the electron?

One solution i’m thinking of is to have the electron send a post request every 30 seconds to the node server and have it reply with data if it has data to send down to the electron but that might get expensive data wise.

Any suggestions?

The electron can subscribe to an event.

On the nodeJS side, using Particle-api-js, you can publish events using: https://github.com/spark/particle-api-js/blob/master/docs/api.md#publishevent

3 Likes