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);
app.use(settings.httpRoot,RED.app);
var red = RED.init(server,settings);
app.use(settings.httpRoot,red);
server.listen(settings.uiPort);

View File

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

View File

@ -29,6 +29,7 @@ var RED = {
settings = userSettings;
server.init(httpServer,settings);
library.init();
return server.app;
},
start: server.start,