mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
0a12c47b35
Move chat service to ES modules GitOrigin-RevId: c08ae8328b8f3b539e6cfe052834b84bb3756330
22 lines
655 B
JavaScript
22 lines
655 B
JavaScript
import logger from '@overleaf/logger'
|
|
import settings from '@overleaf/settings'
|
|
import { mongoClient } from './app/js/mongodb.js'
|
|
import { server } from './app/js/server.js'
|
|
|
|
const port = settings.internal.chat.port
|
|
const host = settings.internal.chat.host
|
|
mongoClient
|
|
.connect()
|
|
.then(() => {
|
|
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)
|
|
})
|