bigbluebutton-Github/bbb-webhooks/application.js

33 lines
999 B
JavaScript
Raw Normal View History

const config = require("./config.js");
const Hook = require("./hook.js");
const IDMapping = require("./id_mapping.js");
const WebHooks = require("./web_hooks.js");
const WebServer = require("./web_server.js");
const redis = require("redis");
2017-09-15 01:09:02 +08:00
const UserMapping = require("./userMapping.js");
// Class that defines the application. Listens for events on redis and starts the
// process to perform the callback calls.
// TODO: add port (-p) and log level (-l) to the command line args
module.exports = class Application {
constructor() {
config.redis.pubSubClient = redis.createClient();
config.redis.client = redis.createClient()
this.webHooks = new WebHooks();
this.webServer = new WebServer();
}
start() {
Hook.initialize(() => {
2017-09-15 01:09:02 +08:00
UserMapping.initialize(() => {
IDMapping.initialize(()=> {
this.webServer.start(config.server.port);
2017-11-02 03:09:27 +08:00
this.webServer.createPermanents();
2017-09-15 01:09:02 +08:00
this.webHooks.start();
});
});
});
}
};