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'
|
|
|
|
import bodyParser from 'body-parser'
|
|
|
|
import * as Router from './router.js'
|
|
|
|
|
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
|
|
|
|
|
|
|
export const app = express()
|
|
|
|
export const server = http.createServer(app)
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2020-03-06 13:33:17 -05:00
|
|
|
app.use(bodyParser.json())
|
|
|
|
app.use(bodyParser.urlencoded({ extended: true }))
|
2018-12-20 14:13:59 -05:00
|
|
|
app.use(metrics.http.monitor(logger))
|
2019-01-04 06:37:48 -05:00
|
|
|
metrics.injectMetricsRoute(app)
|
2014-08-15 05:50:36 -04:00
|
|
|
|
2018-12-20 14:13:59 -05:00
|
|
|
Router.route(app)
|