House blueprint with graphic interactions dashboard

Thank you All

I will check it

Hello!
I was excited to see an instruction on how to do this but I don't run a proxy server on my Raspberry installation.
How else could I serve a picture file like it is described in that blog post without ngyx?
Thanks!!

You can have Node-Red serve static content (i.e. rather than relying on Nginx or something like that). In your settings.js file set the httpStatic directory and put the picture file in that directory.

Note: You have to also set "httpAdminRoot" to use that feature. See the config page for more details: https://nodered.org/docs/configuration#runtime-configuration

If I read this correctly, I have to move the editor and UI path away from root to do that.
Is there another way around? To have the static content at e.g. http://ip-address/content/

Here are the relevant settings:

  // By default, the Node-RED UI is available at http://localhost:1880/
    // The following property can be used to specify a different root path.
    // If set to false, this is disabled.
    httpAdminRoot: '/red',

    // Some nodes, such as HTTP In, can be used to listen for incoming http requests.
    // By default, these are served relative to '/'. The following property
    // can be used to specify a different root path. If set to false, this is
    // disabled.
    //httpNodeRoot: '/red-nodes',

    // The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot',
    // to apply the same root to both parts.
    //httpRoot: '/',

    // 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: path.join('.', 'public'),

I always move the admin interface to somewhere more convenient - /red in this example. Which leaves the root URL free. But you can do it the other way around by changing httpNodeRoot instead of (or indeed as well as) httpAdminRoot.

Not really, since it could collide with all the other internal node-red urls. As Julian mentioned, if you move the httpAdminRoot and set the Static directory, then you can create a "content" directory underneath the public (or static) folder. The resulting url for accessing the image will be something like http://ip-address/content/myimage.jpg

ok, that's clear to me
but where do I put static files if I want to access e.g. image.png from http://:1880/stat_content/image.png ?

The httpStatic setting identifies the directory you should put your content.

I always put mine in the same place for convenience. The above means that you need a folder ~/.node-red/public (assuming you have a standard installation).

...but when accessing it via a URL, don't include the name of the static folder in the URL.
Eg, if your static folder containing your images is .node-red/public then access it via http://:1880/image.png

Unless, you have changed httpNodeRoot

Just got a 'Nice Share' notification from Discourse, for the link that I posted somewhere in this discussion...

But for anybody that wants to create his house blueprint with graphic interactions dashboard, please have a look at our recent node-red-contrib-ui-svg node. That will be much easier compared to using Leaflet ...

2 Likes

Or see the recent discussion thread on using uibuilder with svg :wink:

Incidentally, there are now many ways to create SVG files. Even Microsoft Office.

Always good to have options.

2 Likes