1
0
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:
Nicholas O'Leary 2013-09-26 21:13:09 +01:00
parent 31039c6a12
commit e4f105c7a1
3 changed files with 5 additions and 5 deletions

4
red.js
View File

@ -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);

View File

@ -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");
} }

View File

@ -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,