2019-10-13 03:38:25 +02:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
// create default logger
|
2022-09-28 01:18:01 +02:00
|
|
|
const logger = require('./logger')()
|
2019-10-13 03:38:25 +02:00
|
|
|
|
|
|
|
// get configuration
|
2022-09-28 01:18:01 +02:00
|
|
|
const config = require('./config')(logger)
|
2019-10-13 03:38:25 +02:00
|
|
|
|
|
|
|
// update logger with configuration
|
|
|
|
logger.updateConfig(config.logger)
|
|
|
|
|
2019-11-23 20:39:22 +01:00
|
|
|
// output application version
|
|
|
|
const { name, version } = require('./../package.json')
|
|
|
|
logger.info(`Start ${name} service - version ${version}`)
|
|
|
|
|
2019-10-13 03:38:25 +02:00
|
|
|
// load xmpp module
|
|
|
|
const xmpp = require('./xmpp')(logger, config)
|
|
|
|
|
|
|
|
// load webhook module
|
2019-10-20 17:36:09 +02:00
|
|
|
require('./webhook')(logger, config, xmpp)
|
2019-10-13 03:38:25 +02:00
|
|
|
|
|
|
|
// handle error and process ending
|
|
|
|
require('./error')(logger, xmpp)
|