From 4d0096c064f350aa2db7a6de69e4652e425f65c4 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Sat, 22 Jul 2023 19:39:13 +0200 Subject: [PATCH] =?UTF-8?q?Zastaven=C3=AD=20serveru=20pomoc=C3=AD=20SIGINT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/index.ts b/server/src/index.ts index 3e60338..94373d1 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -232,4 +232,8 @@ server.listen(PORT, () => { console.log(`Server listening on ${HOST}, port ${PORT}`); }); -console.log(process.env.API_KEY) \ No newline at end of file +// 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); +}); \ No newline at end of file