Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gcmcom/430976c77f098c657308e4941d921288 to your computer and use it in GitHub Desktop.
Save gcmcom/430976c77f098c657308e4941d921288 to your computer and use it in GitHub Desktop.
Changing Favicons for node-red Dashboards

Changing Favicons for node-red Dashboards

Dashboards created with node-red-dashboards all have the same favicon

icon192x192

You can easily change this by changing the icons in the .node-red/node-modules/node-red-dashboard/dist, but this change will be lost the next time you update node-red-dashboard.

To get a permanent change, add your icon as files icon64x64.png, icon120x120.png, and icon192x192.png to a folder of your choice, e.g. /home/nodereduser/.node-red/icons, where nodereduser is the user executing node-red.

Then stop node-red and add this to .node-red/settings.js

ui: {
      middleware: function (req, res, next) {
        path = require('path')
        if (['/icon64x64.png', '/icon120x120.png', '/icon192x192.png'].includes(req.url)) {
          res.sendFile(path.resolve(path.join('/home/nodereduser/.node-red/icons', req.url)))
        } else {
          next()
        }
      }
    },

Start node-red again, clear caches on all clients, and enjoy your changes favicons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment