Ref Karlos and Nick O'leary from his youtube post (told me post it here). I'm a newby plz plz be gentle I have my linux file system with nodejs v15 running. Node-red starts, visualizer runs and i can open up json files, deploy and run and all works fine. I've tried so many things.
My file system is structured this way
userDir:"/data/app/home/nol/.nodered",
nodesDir:"/data/app/.nodered/nodes",
core.json is deployed in the test userDir and nodesDir at this moment.
The problem is the core.json which is flowFile never starts on the server, so when i do myserver/red/api/ping it comes back as error in the page, when i manually load the core.json (import) and deploy the ping works.
So the default script isn't starting and I've hunted for reasons why. Also the script isn't loaded in the UI either
So my quesitons are:-
- How do i get the core.json (in settings config) to load by default (as server starts)
- How do i get the UI to autoload the default script or what approach do i need to take to achieve this
Any pointer or references I am so grateful (banging my head here). I am new generally to this, and if I've done something silly, please do not shout hehe
Thanks to everyone here
Karlos
The settings config is in the nodejs script
var settings = {
httpAdminRoot:"/red",
httpNodeRoot: "/api",
userDir:"/data/app/home/nol/.nodered/",
nodesDir:"/data/app/.nodered/nodes",
flowFile:"core.json",
logging:{ console: {
level: "trace",
metrics: false,
audit: false
}
},
functionGlobalContext: { }, // enables global context
editorTheme: {
header: {
title: "Node RED",
image: "/data/app/files/images/custom.gif", // or null to remove image
url: "myurl" // optional url to make the header text/image a link to this url
},
projects: {
enabled: false
},
page: {
title: "Node RED visualizer",
scripts: ["/data/app/.nodered/core.json"]
}
}
};
The NodeJS is
RED.init(server,settings);
// Serve the editor UI from /red
app.use(settings.httpAdminRoot,RED.httpAdmin);
app.use(settings.httpNodeRoot,RED.httpNode);
RED.start().then((result) => {
console.log("Event : Node Red has started successfully");
});