--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
app.use( "/static/", express.static("public") );
--
Hi Nicholas and Julian thank you both very much for replying.
The best way to do it is using the httpStatic config option. This option identifies a local directory from which to serve static web content.
http://nodered.org/docs/configuration.html
(Ignore the bit which says you must set httpAdminRoot - that's only strictly necessary if you have static content whose path clashed with any of the editor's web content.)
When node-red starts up it logs what settings file it is using. Edit that file and restart.
Nick
--
/usr/local/bin/node-red
and then cd lib/node_modules/node-red/
so the total path is: /usr/local/lib/node_modules/node-red
Make a back up copy of the file so you know what it looked like before you fiddle ;-)
(cp settings.js settings.bak)
Hi Dave,
I did just that: specified httpStatic to be a local folder where I store my images. No other settings have been changed. The settings file is the correct one.
However, when I try to serve the images on a web page, but the images don't show up, unlike the rest of html content. I tried several directories and the result is the same.
I specify the img url as /icons/a.jpg ...
httpStatic folder has the subfolder icons.
What is wrong then?
'icons' is a path used by the editor. If you haven't set httpAdminRoot to move the editor to a different root path, it may be conflicting.
Have you tried a different path than 'icons' ?
Nick
Have you specified the full path in httpStatic? Have you restarted node-red?
Colin
On 2 October 2016 at 05:13, Michael Doroshenko
<michael.d...@gmail.com> wrote:
> Hello.
>
> I did just that: specified httpStatic to be a local folder where I store my images. No other settings have been changed. The settings file is the correct one.
>
> However, when I try to serve the images on a web page, but the images don't show up, unlike the rest of html content. I tried several directories and the result is the same.
>
> I specify the img url as /icons/a.jpg ...
> httpStatic folder has the subfolder icons.
>
> What is wrong then?
>
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
> To post to this group, send an email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/36ef9c93-7928-4c29-a2c9-a7ac14b1db80%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/CAL%3D0gLsA-3aE-Yh_f5ynmfP7cjy85R_AFTkOHa3sCsB9f7qsvQ%40mail.gmail.com.
Thank you, Nick!
You've saved my day. As soon as I moved the images to another folder with a different name, changed settings.js appropriately AND restarted node-red, the images started showing up on the web page properly.
Thanks again!
On Sun, Oct 2, 2016, 9:51 AM Nicholas O'Leary <nick....@gmail.com> wrote:
'icons' is a path used by the editor. If you haven't set httpAdminRoot to move the editor to a different root path, it may be conflicting.
Have you tried a different path than 'icons' ?
Nick
On Sun, 2 Oct 2016, 08:42 Colin Law, <cla...@gmail.com> wrote:
Have you specified the full path in httpStatic? Have you restarted node-red?
Colin
On 2 October 2016 at 05:13, Michael Doroshenko
<michael.d...@gmail.com> wrote:
> Hello.
>
> I did just that: specified httpStatic to be a local folder where I store my images. No other settings have been changed. The settings file is the correct one.
>
> However, when I try to serve the images on a web page, but the images don't show up, unlike the rest of html content. I tried several directories and the result is the same.
>
> I specify the img url as /icons/a.jpg ...
> httpStatic folder has the subfolder icons.
>
> What is wrong then?
>
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
> To post to this group, send an email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/36ef9c93-7928-4c29-a2c9-a7ac14b1db80%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/CAL%3D0gLsA-3aE-Yh_f5ynmfP7cjy85R_AFTkOHa3sCsB9f7qsvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/nZZXCDyKih4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/CAF%3Dvhqdaym%3DHpsxiMegqjKtBRezucXE3GDiywrcxtLHuOCf9Ew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--