How to display an image on Node red dashboard using template node

Hi Jude,

Steps

  1. There is a settings.js file, which contains the path of your static dashboard contents.
    It is usually located in C:\Users\{{userName}}\.node-red where {{userName}} is your user name.
    Open this file end edit the following line, and save the file.
...
    // When httpAdminRoot is used to move the UI to a different root path, the
    // following property can be used to identify a directory of static content
    // that should be served at http://localhost:1880/.
    // httpStatic: '/home/nol/node-red-static/',
    httpStatic: 'C:\Users\{{userName}}\.node-red\static' 
...

Again, the {{userName}} is your user name.

  1. Now create a folder in C:\Users\{{userName}}\.node-red called static.
  2. Put your picture inside
  3. Restart your node-red
  4. Now you can use the relative path to the image from your static folder, just use a / before it.

Example:

Daniel

8 Likes