Hello,
This had been a working web page for me before my computer broke down.
A web page which shows image in a normal html file wont render in a node red hosted web page
1.
You cannot load a file from their local PC (D:\....). This is blocked if loading the page itself from a server due to cross-domain security restrictions (and rightly so).
Your xlink:href is incorrectly written in both cases.
Where is the png file actually located (presumably on the server) and how have you configured Node-RED to tell it how to serve files from that location?
Exactly i also felt so.. thats why I had hosted them in the same node red server in a different end point http in using definite paths..
This is working now but is that the correct way to do it?
For a static image, the better way would be to use the httpStatic property in settings.js to define a static folder. From my setttings 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: process.env.httpStatic || path.join('.', 'public'),
/* OR multiple static sources can be created using an array of objects... */
// httpStatic: [
// {path: path.join('.', 'pics'), root: "/img/"},
// {path: path.join('.', 'reports'), root: "/doc/"},
// ],
/** All static routes will be appended to httpStaticRoot
* e.g. if httpStatic = "/home/nol/docs" and httpStaticRoot = "/static/"
* then "/home/nol/docs" will be served at "/static/"
* e.g. if httpStatic = [{path: '/home/nol/pics/', root: "/img/"}]
* and httpStaticRoot = "/static/"
* then "/home/nol/pics/" will be served at "/static/img/"
*/
// httpStaticRoot: '/static/',
You don't need to define an http-in/-out pair of nodes to serve static content.