mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #1529 from btsimonh/websocketsnonadmin
Fix WebSockets not working when httpAdminRoot false
This commit is contained in:
commit
14efd0b2f9
10
red/red.js
10
red/red.js
@ -69,13 +69,21 @@ module.exports = {
|
||||
runtime.init(userSettings,api);
|
||||
api.init(httpServer,runtime);
|
||||
apiEnabled = true;
|
||||
server = runtime.adminApi.server;
|
||||
runtime.server = runtime.adminApi.server;
|
||||
} else {
|
||||
runtime.init(userSettings);
|
||||
apiEnabled = false;
|
||||
if (httpServer){
|
||||
server = httpServer;
|
||||
runtime.server = httpServer;
|
||||
} else {
|
||||
server = runtime.adminApi.server;
|
||||
runtime.server = runtime.adminApi.server; // useless at this point, but at least harmless.
|
||||
}
|
||||
}
|
||||
adminApp = runtime.adminApi.adminApp;
|
||||
nodeApp = runtime.nodeApp;
|
||||
server = runtime.adminApi.server;
|
||||
return;
|
||||
},
|
||||
start: function() {
|
||||
|
@ -84,7 +84,7 @@ function createNodeApi(node) {
|
||||
red.auth = runtime.adminApi.auth;
|
||||
red.httpAdmin = runtime.adminApi.adminApp;
|
||||
red.httpNode = runtime.nodeApp;
|
||||
red.server = runtime.adminApi.server;
|
||||
red.server = runtime.server;
|
||||
} else {
|
||||
//TODO: runtime.adminApi is always stubbed if not enabled, so this block
|
||||
// is unused - but may be needed for the unit tests
|
||||
|
Loading…
Reference in New Issue
Block a user