mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
a540754f6e
[misc] bulk replace localhost with 127.0.0.1 GitOrigin-RevId: d238f3635302e8ff5500d611108c4d1bef216726
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, '127.0.0.1')
|
|
}
|
|
return serverPromise
|
|
}
|