mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
e0d91eaa26
Downgrade all INFO logs to DEBUG GitOrigin-RevId: 05ed582ef0721fcada059f0ad158565f50feca27
28 lines
774 B
JavaScript
28 lines
774 B
JavaScript
const logger = require('@overleaf/logger')
|
|
const settings = require('@overleaf/settings')
|
|
|
|
const mongodb = require('./app/js/mongodb')
|
|
const Server = require('./app/js/server')
|
|
|
|
if (!module.parent) {
|
|
// Called directly
|
|
const port = settings.internal.chat.port
|
|
const host = settings.internal.chat.host
|
|
mongodb
|
|
.waitForDb()
|
|
.then(() => {
|
|
Server.server.listen(port, host, function (err) {
|
|
if (err) {
|
|
logger.fatal({ err }, `Cannot bind to ${host}:${port}. Exiting.`)
|
|
process.exit(1)
|
|
}
|
|
logger.debug(`Chat starting up, listening on ${host}:${port}`)
|
|
})
|
|
})
|
|
.catch(err => {
|
|
logger.fatal({ err }, 'Cannot connect to mongo. Exiting.')
|
|
process.exit(1)
|
|
})
|
|
}
|
|
|
|
module.exports = Server.server
|