Httpstatic image path

Embarrassed to ask, but I'm stumped. Windows 10 Pro. Standard installation.
In settings.js:
httpStatic: '/images/',
In console:
C:\images
Img path in Template:

Nada in browser. I thought httpStatic '/images/' was the path, requiring only the image name? (and I have tried progressing further up the path i.e. '.node-red/images/image.png', etc.) without any success. The confusing thing is it worked previously, then started this weird behavior....

Any ideas?

that should be fine as long as you haven’t changed any of the other paths.

That isn’t “up” the path from \images of course.

You might check manually to see if you made a typo?

Bizarre...
In the settings, I have httpStatic: '/images/'; in console, it shows as "C:\images"
I thought '/images/' was relative to NR?
I made a copy of images under "C:", and boom! the image displays.
So maybe I'm confused on the 'images' path relative to NR?

The httpStatic path should be an absolute path. If you use a relative path, it will be relative to the working directory of the Node-RED process. A path beginning with / will always be treated as an absolute path. If you want it to be relative you'd start it with ./

2 Likes

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