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);
|
var red = RED.init(server,settings);
|
||||||
app.use(settings.httpRoot,RED.app);
|
app.use(settings.httpRoot,red);
|
||||||
|
|
||||||
|
|
||||||
server.listen(settings.uiPort);
|
server.listen(settings.uiPort);
|
||||||
|
@ -242,7 +242,7 @@ module.exports.load = function() {
|
|||||||
if (stats.isFile()) {
|
if (stats.isFile()) {
|
||||||
if (/\.js$/.test(fn)) {
|
if (/\.js$/.test(fn)) {
|
||||||
try {
|
try {
|
||||||
require("../"+dir+"/"+fn);
|
require(dir+"/"+fn);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
util.log("["+fn+"] "+err);
|
util.log("["+fn+"] "+err);
|
||||||
//console.log(err.stack);
|
//console.log(err.stack);
|
||||||
@ -256,8 +256,7 @@ module.exports.load = function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
loadNodes(__dirname+"/../nodes");
|
||||||
loadNodes("nodes");
|
|
||||||
|
|
||||||
//events.emit("nodes-loaded");
|
//events.emit("nodes-loaded");
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ var RED = {
|
|||||||
settings = userSettings;
|
settings = userSettings;
|
||||||
server.init(httpServer,settings);
|
server.init(httpServer,settings);
|
||||||
library.init();
|
library.init();
|
||||||
|
return server.app;
|
||||||
},
|
},
|
||||||
|
|
||||||
start: server.start,
|
start: server.start,
|
||||||
|
Loading…
Reference in New Issue
Block a user