2022-12-13 07:37:49 -05:00
|
|
|
import http from 'http'
|
|
|
|
import metrics from '@overleaf/metrics'
|
|
|
|
import logger from '@overleaf/logger'
|
|
|
|
import express from 'express'
|
2022-12-21 10:39:13 -05:00
|
|
|
import bodyParser from 'body-parser'
|
|
|
|
import * as Router from './router.js'
|
2022-12-13 07:37:49 -05:00
|
|
|
|
2018-12-20 14:13:59 -05:00
|
|
|
metrics.initialize('chat')
|
2019-02-05 13:50:57 -05:00
|
|
|
logger.initialize('chat')
|
2022-12-13 07:37:49 -05:00
|
|
|
|
2022-12-21 10:39:13 -05:00
|
|
|
export const app = express()
|
|
|
|
export const server = http.createServer(app)
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2022-12-21 10:39:13 -05:00
|
|
|
app.use(bodyParser.json())
|
|
|
|
app.use(bodyParser.urlencoded({ extended: true }))
|
|
|
|
app.use(metrics.http.monitor(logger))
|
|
|
|
metrics.injectMetricsRoute(app)
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2022-12-21 10:39:13 -05:00
|
|
|
Router.route(app)
|