mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 21:43:52 -05:00
5855ba7b49
Replace the GCP trace agent with OpenTelemetry GitOrigin-RevId: 591410029349e4ef5a39a5b79868e57c7bd089b6
27 lines
799 B
JavaScript
27 lines
799 B
JavaScript
// Metrics must be initialized before importing anything else
|
|
import '@overleaf/metrics/initialize.js'
|
|
|
|
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)
|
|
})
|