Hi there,
I have one machine running Node-RED on Windows. When it starts up, it displays the following :
15 Nov 14:21:56 - [info] Node-RED version: v0.17.5
15 Nov 14:21:56 - [info] Node.js version: v4.4.2
15 Nov 14:21:56 - [info] Windows_NT 10.0.15063 x64 LE
...
15 Nov 14:21:58 - [info] User directory : \Users\donck\.node-red
So I thought I could create a "static" directory under "\Users\donck\.node-red" and edit my settings.js to serve static files
At first I used:
httpStatic: 'C:\\Users\\donck\\.node-red\\static',
That worked, but I didnt like that it was dependent from my OS and username so I wanted to use a relative path:
httpStatic: 'static',
or
httpStatic: './static',
But that does NOT work
I ended up using:
var path = require("path"); // <--- prepend this line to settings.js
httpStatic: path.join(process.env.HOMEPATH,".node-red","static"),
(path.join returns "\Users\donck\.node-red\static")
Is there a simpler way to use a relative path for static stuff that would also work on Windows machines ?
Best regards
DoNcK