Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!userSettings.coreNodesDir) {
userSettings.coreNodesDir = path.dirname(require.resolve("@node-red/nodes"))
}
redUtil.init(userSettings);
if (userSettings.httpAdminRoot !== false) {
// Initialise the runtime
runtime.init(userSettings,httpServer,api);
// Initialise the editor-api
api.init(userSettings,httpServer,runtime.storage,runtime);
// Attach the runtime admin app to the api admin app
api.httpAdmin.use(runtime.httpAdmin);
apiEnabled = true;
server = httpServer;
} else {
runtime.init(userSettings);
apiEnabled = false;
if (httpServer) {
server = httpServer;
} else {
server = null;
}
}
return;
},
/**
if (!userSettings) {
userSettings = httpServer;
httpServer = null;
}
if (!userSettings.SKIP_BUILD_CHECK) {
checkVersion(userSettings);
}
if (!userSettings.coreNodesDir) {
userSettings.coreNodesDir = path.dirname(require.resolve("@node-red/nodes"))
}
redUtil.init(userSettings);
if (userSettings.httpAdminRoot !== false) {
// Initialise the runtime
runtime.init(userSettings,httpServer,api);
// Initialise the editor-api
api.init(userSettings,httpServer,runtime.storage,runtime);
// Attach the runtime admin app to the api admin app
api.httpAdmin.use(runtime.httpAdmin);
apiEnabled = true;
server = httpServer;
} else {
runtime.init(userSettings);
apiEnabled = false;
if (httpServer) {
server = httpServer;
} else {
server = null;
}
}
if (!userSettings.SKIP_BUILD_CHECK) {
checkVersion(userSettings);
}
if (!userSettings.coreNodesDir) {
userSettings.coreNodesDir = path.dirname(require.resolve("@node-red/nodes"))
}
redUtil.init(userSettings);
if (userSettings.httpAdminRoot !== false) {
// Initialise the runtime
runtime.init(userSettings,httpServer,api);
// Initialise the editor-api
api.init(userSettings,httpServer,runtime.storage,runtime);
// Attach the runtime admin app to the api admin app
api.httpAdmin.use(runtime.httpAdmin);
apiEnabled = true;
server = httpServer;
} else {
runtime.init(userSettings);
apiEnabled = false;
if (httpServer) {
server = httpServer;
} else {
server = null;
}
}
return;
},
/**
httpServer = null;
}
if (!userSettings.SKIP_BUILD_CHECK) {
checkVersion(userSettings);
}
if (!userSettings.coreNodesDir) {
userSettings.coreNodesDir = path.dirname(require.resolve("@node-red/nodes"))
}
redUtil.init(userSettings);
if (userSettings.httpAdminRoot !== false) {
// Initialise the runtime
runtime.init(userSettings,httpServer,api);
// Initialise the editor-api
api.init(userSettings,httpServer,runtime.storage,runtime);
// Attach the runtime admin app to the api admin app
api.httpAdmin.use(runtime.httpAdmin);
apiEnabled = true;
server = httpServer;
} else {
runtime.init(userSettings);
apiEnabled = false;
if (httpServer) {
server = httpServer;
} else {
server = null;
}
}
return;
},
private patchRuntimeExec() {
newExec.init(RED.runtime._, this.status);
runtime._.nodes.paletteEditorEnabled = () => { return true };
}
get nodes() { return runtime._.nodes },
get version() { return runtime._.version },
* runtime. The details of this API remain undocumented as they should not
* be used directly.
*
* Most administrative actions should be performed use the runtime api
* under [node-red.runtime]{@link node-red.runtime}.
*
* @memberof node-red
*/
get nodes() { return runtime._.nodes },
/**
* Runtime events emitter
* @see @node-red/runtime_events
* @memberof node-red
*/
events: runtime.events,
/**
* This provides access to the internal settings module of the
* runtime.
*
* @memberof node-red
*/
get settings() { return runtime._.settings },
/**
* Get the version of the runtime
* @return {String} - the runtime version
* @function
* @memberof node-red
*/
get httpNode() { return runtime.httpNode },
start: function() {
return runtime.start().then(function() {
if (apiEnabled) {
return api.start();
}
});
},
/**