mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
f9aaa4d5de
Upgrade the Mongo driver in the chat service GitOrigin-RevId: 12808e624b75f0adc7fd474f774b855dc2eadefd
28 lines
784 B
JavaScript
28 lines
784 B
JavaScript
const logger = require('@overleaf/logger')
|
|
const settings = require('@overleaf/settings')
|
|
|
|
const { mongoClient } = 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
|
|
mongoClient
|
|
.connect()
|
|
.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
|