2020-09-09 09:37:56 +00:00
|
|
|
const metrics = require('@overleaf/metrics')
|
2018-12-20 19:13:59 +00:00
|
|
|
metrics.initialize('chat')
|
2021-12-14 13:00:35 +00:00
|
|
|
const logger = require('@overleaf/logger')
|
2019-02-05 18:50:57 +00:00
|
|
|
logger.initialize('chat')
|
2018-12-20 19:13:59 +00:00
|
|
|
const express = require('express')
|
2020-03-06 18:33:17 +00:00
|
|
|
const bodyParser = require('body-parser')
|
2018-12-20 19:13:59 +00:00
|
|
|
const app = express()
|
|
|
|
const server = require('http').createServer(app)
|
|
|
|
const Router = require('./router')
|
2014-08-15 09:50:36 +00:00
|
|
|
|
2020-03-06 18:33:17 +00:00
|
|
|
app.use(bodyParser.json())
|
|
|
|
app.use(bodyParser.urlencoded({ extended: true }))
|
2018-12-20 19:13:59 +00:00
|
|
|
app.use(metrics.http.monitor(logger))
|
2019-01-04 11:37:48 +00:00
|
|
|
metrics.injectMetricsRoute(app)
|
2014-08-15 09:50:36 +00:00
|
|
|
|
2018-12-20 19:13:59 +00:00
|
|
|
Router.route(app)
|
2014-08-15 09:50:36 +00:00
|
|
|
|
2018-12-20 19:13:59 +00:00
|
|
|
module.exports = {
|
|
|
|
server,
|
2021-07-13 11:04:48 +00:00
|
|
|
app,
|
2018-12-20 19:13:59 +00:00
|
|
|
}
|