# httpStatic and image

**URL:** <https://discourse.nodered.org/t/httpstatic-and-image/1485>\
**Category:** General\
**Created:** [10 July 2018 13:57 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485 "2018-07-10T13:57:55Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [10 July 2018 13:57 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/1 "2018-07-10T13:57:55Z")

</div>

Trying to store some images on the PI and then show the images using the html template.

There was some mention of setting the 'httpStatic' to point to where the files will be stored.  
But I am having bit of problem of locating the settings.js file that was mentioned.  
Here is screen shot . Can not see any settings.js file.

![settings](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/845f9f5aafaad59b1002403ed441721211ea7039.jpg)

> <https://stackoverflow.com/questions/41807963/node-red-dashboard-include-images>

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [10 July 2018 14:07 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/2 "2018-07-10T14:07:04Z")

</div>

If you start node-red from the command line it will tell you which settings.js it is using and the path to it.

---

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [10 July 2018 14:59 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/3 "2018-07-10T14:59:15Z")

</div>

Hi UKMoose,  
Thank you.  
On the Command Line, I ran :  
node-red-stop ( to stopped Node Red because Node Red was running already)  
node-red-start  
Then I saw the path to the path to the settings.js

I am sure this will be handy for others.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 July 2018 15:12 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/4 "2018-07-10T15:12:27Z")

</div>

Where is it? It should be in .node-red

---

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [10 July 2018 15:46 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/5 "2018-07-10T15:46:42Z")

</div>

Hi Uk Moose,  
I changed the httpStatic to : httpStatic: ' home/pi/personal/ ',  
Put the image in the home/pi/personal directory

Inserted a html template with the following but the image is not pulling up.  
Any ideas?

![](https://sea2.discourse-cdn.com/flex026/home/pi/personal/img_chania.jpg)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [10 July 2018 15:54 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/6 "2018-07-10T15:54:42Z")

</div>

No need to address your query to one person, as there's lots of people here who can give advice.

Your image didn't make it ..

And as Colin said, if you had already run Node-RED it should have been where you were looking. so where was it?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [10 July 2018 15:59 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/7 "2018-07-10T15:59:40Z")

</div>

Aside from the precise location of the settings file, which is important to confirm, when you say:

> httpStatic: ' home/pi/personal/ ',

did you mean: `'/home/pi/personal/'` - the slash at the front is quite important.

Also, you need to restart Node-RED whenever you edit the settings file.

---

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [10 July 2018 17:07 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/8 "2018-07-10T17:07:13Z")

</div>

Hi Nick and rest of team.  
0. The location of the settings.js file was:  
/usr/lib/node\_modules/node-red/settings.js

I manuevered to that location and did a sudo nano settings.js

1. Attached is image of the settings.js file  
Note: changed it to '/home/pi/sweetwater/',  
Then typed in ctrl + o then ctrl + x

2. Then created a html template node . But the .jpg file does not show.

## sweetwater pic
 ![](https://sea2.discourse-cdn.com/flex026/home/pi/sweetwater/img_chania.jpg)

 ![httpStatic](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/14ba652d8ffd98e126b360e4359df58bf5f2fba3.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 July 2018 17:23 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/9 "2018-07-10T17:23:18Z")

</div>

Back to some basic questions

1. What version of NR and node.js are you running? You can get them from the node-red log when you start node-red manually using `node-red-start`
2. How did you install node-red on the Pi?
3. have you ever run the bash script located here: [https://nodered.org/docs/hardware/raspberrypi](https://nodered.org/docs/hardware/raspberrypi)  
If not, I suggest you backup your `flows_raspberrypi.json` and `flows_raspberrypi_cred.json` files and then run the script. Then see if the settings.js is in the .node-red folder.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [10 July 2018 17:24 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/10 "2018-07-10T17:24:10Z")

</div>

1. You should probably remove the /home/nol etc line

2. never use sudo unless you actually need to.

3. As Nick said you need to restart Node-RED after changing the settings file. When Node-RED restarts check it is still picking up the same settings.js file

4. What have you typed into the html template?

---

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [10 July 2018 17:35 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/11 "2018-07-10T17:35:39Z")

</div>

1.running node red V0.18.4  
2.running PI Raspian. Installed from the 'NOOB' which included the Node Red.  
3. the /home/nol line ( that was commented out //)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 July 2018 19:25 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/12 "2018-07-10T19:25:52Z")

</div>

Run the bash \<(curl script in the raspbian install instructions [1]. That should give you an up to date node red environment with everything in the right place.

[1] [https://nodered.org/docs/hardware/raspberrypi](https://nodered.org/docs/hardware/raspberrypi)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 July 2018 22:11 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/13 "2018-07-10T22:11:04Z")

</div>

The settings.js in the /usr dir is the template one that gets copied over to your user directory on first run. You should only edit the one in your users directory (typically /home/pi/.node-red on a pi etc)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [11 July 2018 08:38 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/14 "2018-07-11T08:38:20Z")

</div>

Ceejay if you read the thread, it wasn’t copied over and Node-RED was picking up the other one.

And aren’t you supposed to be on vacation?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 July 2018 09:07 UTC](https://discourse.nodered.org/t/httpstatic-and-image/1485/15 "2018-07-11T09:07:32Z")

</div>

In the very early days of Node-RED, before we had the concept of a user data directory, you would edit the settings file in the install directory of Node-RED.

We then added the user data directory to keep things separate. However we needed to not break existing users - so the code checks the modified timestamp of the settings file in the install directory. If that has been edited, and one doesn't exist in the user directory, we'll use the one in the install directory rather than copy over to the user directory.

So it is possible to get into this state.
