Page 1 of 1

Serving React App with node-red

Posted: Sat Jan 21, 2023 1:09 am
by bertankursun2
Hello!

We're trying to create a GUI to allow the user to interface with the PHL. We want to host the webpage on the device itself.

Is there a way to serve a React.js webpage to 10.0.0.1 like the GUI example with node-red?
If so, what is the best way to upload the HTML and JS files to the firmware or device?

Are we approaching this problem the correct way? Any help would be appreciated.

Thank you for your time.

Re: Serving React App with node-red

Posted: Thu Jan 26, 2023 4:46 pm
by hendrikkayser
Hello,
for Node-Red example I can only tell that the webserver comes with the Node-Red installation, so we didn't have to set up much in that regard. From here it seems that it is somehow possible by using the uibuilder node to use it for React.
For transferring files to the PHL you can use the scp command.

Re: Serving React App with node-red

Posted: Thu Feb 02, 2023 9:42 am
by tobiasherzke
Searching for serve web pages with node-red finds a couple of hits that look relevant to your project.

That said, the PHL runs Linux on a 32 bit ARM processor, so any other common technology to serve web pages from Linux can be realized on the PHL, and may be cheaper, CPU-wise, than using node-red.