Zastavení serveru pomocí SIGINT

This commit is contained in:
Martin Berka 2023-07-22 19:39:13 +02:00
parent 347cbc7228
commit 4d0096c064

View File

@ -232,4 +232,8 @@ server.listen(PORT, () => {
console.log(`Server listening on ${HOST}, port ${PORT}`);
});
console.log(process.env.API_KEY)
// Umožníme vypnutí serveru přes SIGINT, jinak Docker čeká než ho sestřelí
process.on('SIGINT', function () {
console.log("\nSIGINT (Ctrl-C), vypínám server");
process.exit(0);
});