When to close Database with node-sqlite3 and express?
SIGINT
is the signal you're looking for; most terminals send a SIGINT
on Ctrl+C
.
You could try something like this -
process.on('SIGINT', () => { db.close(); server.close();});
SIGINT
is the signal you're looking for; most terminals send a SIGINT
on Ctrl+C
.
You could try something like this -
process.on('SIGINT', () => { db.close(); server.close();});