mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 07:40:59 +00:00
ee85d948e2
GitOrigin-RevId: ef2ef77e26df59d1af3df6dc664e284d3c70102d
24 lines
695 B
JavaScript
24 lines
695 B
JavaScript
import Settings from '@overleaf/settings'
|
|
import logger from '@overleaf/logger'
|
|
import OError from '@overleaf/o-error'
|
|
import { mongoClient } from './app/js/mongodb.js'
|
|
import { app } from './app/js/server.js'
|
|
|
|
const host = Settings.internal.history.host
|
|
const port = Settings.internal.history.port
|
|
|
|
mongoClient
|
|
.connect()
|
|
.then(() => {
|
|
app.listen(port, host, error => {
|
|
if (error != null) {
|
|
logger.error(OError.tag(error, 'could not start history server'))
|
|
} else {
|
|
logger.debug(`history starting up, listening on ${host}:${port}`)
|
|
}
|
|
})
|
|
})
|
|
.catch(err => {
|
|
logger.fatal({ err }, 'Cannot connect to mongo. Exiting.')
|
|
process.exit(1)
|
|
})
|