overleaf/services/chat/test/acceptance/js/helpers/ChatApp.js
Lucie Germain afa66aef49 Merge pull request #11051 from overleaf/revert-10983-revert-10901-lg-openapi-chat
Migrate chat service to OpenAPI : (Revert of the Revert)

GitOrigin-RevId: 77a34fef20f77344e01461d42b531c623cf28203
2023-01-05 09:05:00 +00:00

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
}