Skip to content
Snippets Groups Projects
Unverified Commit cfffb613 authored by Anton Georgiev's avatar Anton Georgiev Committed by GitHub
Browse files

Merge pull request #12107 from thifranc/develop

[add] enable bbb-webhooks to bind nodejs localhost, and make it default
parents 36921916 fb859729
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ module.exports = class Application {
UserMapping.initialize(() => {
IDMapping.initialize(()=> {
async.parallel([
(callback) => { this.webServer.start(config.get("server.port"), callback) },
(callback) => { this.webServer.start(config.get("server.port"), config.get("server.bind"), callback) },
(callback) => { this.webServer.createPermanents(callback) },
(callback) => { this.webHooks.start(callback) }
], (err,results) => {
......
......@@ -12,3 +12,6 @@ hooks:
redis:
host: REDIS_HOST
port: REDIS_PORT
server:
bind: SERVER_BIND_IP
port: SERVER_PORT
......@@ -8,6 +8,7 @@ bbb:
# The port in which the API server will run.
server:
bind: 127.0.0.1
port: 3005
# Web hooks configs
......
......@@ -17,14 +17,15 @@ module.exports = class WebServer {
this._registerRoutes();
}
start(port, callback) {
this.server = this.app.listen(port);
if (this.server.address() == null) {
Logger.error("[WebServer] aborting, could not bind to port", port,
process.exit(1));
}
Logger.info("[WebServer] listening on port", port, "in", this.app.settings.env.toUpperCase(), "mode");
typeof callback === 'function' ? callback(null,"k") : undefined;
start(port, bind, callback) {
this.server = this.app.listen(port, bind, () => {
if (this.server.address() == null) {
Logger.error("[WebServer] aborting, could not bind to port", port,
process.exit(1));
}
Logger.info("[WebServer] listening on port", port, "in", this.app.settings.env.toUpperCase(), "mode");
typeof callback === 'function' ? callback(null,"k") : undefined;
});
}
_registerRoutes() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment