diff --git a/nodes/http-auth.html b/nodes/http-auth.html index 1cb2bdd..cfa545b 100644 --- a/nodes/http-auth.html +++ b/nodes/http-auth.html @@ -71,7 +71,7 @@

- +

Config

diff --git a/nodes/http-auth.js b/nodes/http-auth.js index e8db485..e820737 100644 --- a/nodes/http-auth.js +++ b/nodes/http-auth.js @@ -99,4 +99,20 @@ module.exports = function (RED) { } RED.nodes.registerType('http-basic-auth', HttpAuthNode); + + if (RED.httpAdmin) { + const path = require('path'); + RED.httpAdmin.get('/node-red-http-basic-auth/images/:name', (req, res, next) => { + const options = { + root: path.join(__dirname, '..', 'images'), + dotfiles: 'deny', + }; + const fileName = req.params.name; + res.sendFile(fileName, options, (err) => { + if (err) { + next(err); + } + }); + }); + } };