Node red values to html page

HI friends ,

I am trying to dispaly node red values directly in apache webserver html pages running parallel with node red can any one help with sample flows,

M.Senthil Kumar

Hi @Senthil567

More info might be needed here, such as are you using dashboard for example?
if not, and you quite lterally need some values from Node RED into a webpage:

Then you might want to look at the HTTP IN Node, coupled with the HTTP Response Node

This can be used to create a simple API in Node RED, where the response can be returned to the calling client/UA as a JSON object for example

I would recommend using something like PHP, to hide the HTTP request from the UA

If they are static pages, you will need to adjust things I'm afraid since there is no way do put dynamic data into static pages without some serious workarounds.

However, Apache can work as a reverse proxy and so can proxy anything that Node-RED can deliver.

Doing so will give you 3 main ways of doing what you want.

  1. Use UIBUILDER which will let you add a simple library to your existing web pages that will add communication with Node-RED and enable them to be data-driven.
  2. Use http-in/-out paired nodes as Marcus suggests - however, you would need to deliver the whole page dynamically, move the static page into Node-RED template nodes. So there might be some overheads with that approach and you still wouldn't get true 2-way real-time comes as you can with UIBUILDER.
  3. Just use the Node-RED Dashboard. But this delivers pretty heavyweight code and adds restrictions about what you can easily do. Dashboard is great if you are starting from scratch and have limited web development capability. Not so good if you have existing pages and want to add dynamic data from Node-RED.
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.