fix: robust web/dist path resolution and graceful shutdown
This commit is contained in:
@@ -6,3 +6,13 @@ const config = loadConfig()
|
||||
const db = openDatabase(config.dbPath)
|
||||
const app = await buildApp({ db, config })
|
||||
await app.listen({ port: config.port, host: '0.0.0.0' })
|
||||
|
||||
for (const signal of ['SIGINT', 'SIGTERM'] as const) {
|
||||
process.on(signal, () => {
|
||||
void (async () => {
|
||||
await app.close()
|
||||
db.close()
|
||||
process.exit(0)
|
||||
})()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user