mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 08:02:50 +00: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
|
|
}
|