Zastavení serveru pomocí SIGINT
This commit is contained in:
1 parent
347cbc7228
commit
4d0096c064
1 file changed
+5
-1
+5
-1
@@ -232,4 +232,8 @@ server.listen(PORT, () => {
|
|||||||
console.log(`Server listening on ${HOST}, port ${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);
|
||||||
|
});
|
||||||
Reference in new issue
Block a user