I decided learning how to use uibuilder (it was about time...). In my first flow I want to create a web page with a single image, using only html/css/javascript. I will not try any front-end at this stage as this is purely for learning and to get acquainted with uibuilder.
I wonder how should be the directory structure for storing the images. I use projects so my the home folder for the testing flow is:
~/.node-red/projects/UI-BUILDER/uibuilder
Where I am supposed to store the image file ?
My htm file looks like:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>Hello Dashboard</p>
<img src="speed-07.jpg" alt="speedometer" width="400" height="400">
<canvas id="image-01" width="400" height="400"></canvas>
<script src="../uibuilder/vendor/socket.io/socket.io.js"></script>
<script src="./uibuilderfe.min.js"></script> <!-- //prod version -->
<!-- OPTIONAL: Put your custom code in here -->
<script src="./index.js"></script>
</body>
</html>
I see that the index.html
original example displays a blue logo (file node-blue-192x192.png) stored in:
C:\Users\OCM\.node-red\node_modules\node-red-contrib-uibuilder\nodes\src\images
I suppose I could move the png file to the same place but I wanted to learn what would be the best practice on storing resources for uibuilder. Ideally I wanted to use a directory structure outside the project folder (like I use to do with Node-RED dashboard using the HTTP static directory).