overleaf/services/chat/test/acceptance/js/helpers/ChatApp.js
Jakob Ackermann a540754f6e Merge pull request #18116 from overleaf/jpa-bulk-replace-localhost
[misc] bulk replace localhost with 127.0.0.1

GitOrigin-RevId: d238f3635302e8ff5500d611108c4d1bef216726
2024-04-26 08:04:39 +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, '127.0.0.1')
}
return serverPromise
}