mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Make the runtime embeddedable
This commit is contained in:
parent
31039c6a12
commit
e4f105c7a1
4
red.js
4
red.js
@ -49,8 +49,8 @@ if (settings.httpAuth) {
|
||||
);
|
||||
}
|
||||
|
||||
RED.init(server,settings);
|
||||
app.use(settings.httpRoot,RED.app);
|
||||
var red = RED.init(server,settings);
|
||||
app.use(settings.httpRoot,red);
|
||||
|
||||
|
||||
server.listen(settings.uiPort);
|
||||
|
@ -242,7 +242,7 @@ module.exports.load = function() {
|
||||
if (stats.isFile()) {
|
||||
if (/\.js$/.test(fn)) {
|
||||
try {
|
||||
require("../"+dir+"/"+fn);
|
||||
require(dir+"/"+fn);
|
||||
} catch(err) {
|
||||
util.log("["+fn+"] "+err);
|
||||
//console.log(err.stack);
|
||||
@ -256,8 +256,7 @@ module.exports.load = function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadNodes("nodes");
|
||||
loadNodes(__dirname+"/../nodes");
|
||||
|
||||
//events.emit("nodes-loaded");
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ var RED = {
|
||||
settings = userSettings;
|
||||
server.init(httpServer,settings);
|
||||
library.init();
|
||||
return server.app;
|
||||
},
|
||||
|
||||
start: server.start,
|
||||
|
Loading…
Reference in New Issue
Block a user