mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-30 21:30:49 +00:00
f6c1e2738d
Migrate spelling to ES modules GitOrigin-RevId: 4a200c8d1c28be44027cc8a3097e42575ab6593f
22 lines
582 B
JavaScript
22 lines
582 B
JavaScript
import Settings from '@overleaf/settings'
|
|
import logger from '@overleaf/logger'
|
|
import { app } from './app/js/server.js'
|
|
import * as ASpell from './app/js/ASpell.js'
|
|
|
|
const { host = 'localhost', port = 3005 } = Settings.internal?.spelling ?? {}
|
|
|
|
ASpell.startCacheDump()
|
|
|
|
const server = app.listen(port, host, function (error) {
|
|
if (error) {
|
|
throw error
|
|
}
|
|
logger.info({ host, port }, 'spelling HTTP server starting up')
|
|
})
|
|
|
|
process.on('SIGTERM', () => {
|
|
ASpell.stopCacheDump()
|
|
server.close(() => {
|
|
logger.info({ host, port }, 'spelling HTTP server closed')
|
|
})
|
|
})
|