mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 09:53:30 -05:00
afa66aef49
Migrate chat service to OpenAPI : (Revert of the Revert) GitOrigin-RevId: 77a34fef20f77344e01461d42b531c623cf28203
15 lines
413 B
JavaScript
15 lines
413 B
JavaScript
import { createServer } from '../../../../app/js/server.js'
|
|
import { promisify } from 'util'
|
|
|
|
export { db } from '../../../../app/js/mongodb.js'
|
|
|
|
let serverPromise = null
|
|
|
|
export async function ensureRunning() {
|
|
if (!serverPromise) {
|
|
const { app } = await createServer()
|
|
const startServer = promisify(app.listen.bind(app))
|
|
serverPromise = startServer(3010, 'localhost')
|
|
}
|
|
return serverPromise
|
|
}
|