mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
7ed9b04c3c
Revert "Migrate chat service to OpenAPI" GitOrigin-RevId: 39bdfd98bc55f8d9d56fb18bb288749aa13f25e0
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)
|
|
})
|