Trigger Electron to do something when a button on a remote webpage is pressed


#1

Hi there

Wondering if anyone can help, or give advice!

I’m starting a robotics project and I want to use Electron at the heart of it. A raspberry pi is basically the brains of what I want to build. On that Raspberry Pi i’ve got a webserver with a simple page on it.

I basically want Electron to perform a task on the local raspberry pi (e.,g show a picture) when buttons are pressed on a remote website.

Is this possible, and whats the best way to go about trying to acheive this. Does there need to be a layer of NodeJS to deal with the server side?

Any help is greatly appreciated!


#2

The main way of communicating between web servers is via HTTP requests. Node has a built-in library for handling these.