commit 130f5391f81e1db7748481ba38f47bb437210660
parent 68f11f99cf462893b1b730fd97fc693b4c568fd6
Author: RobinLinus <RobinLinus@users.noreply.github.com>
Date: Tue, 22 Dec 2020 17:55:37 +0100
Merge pull request #162 from LEXUGE/patch-1
Add support for SIGINT and SIGTERM handling
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/server/index.js b/server/index.js
@@ -1,3 +1,16 @@
+var process = require('process')
+// Handle SIGINT
+process.on('SIGINT', () => {
+ console.info("SIGINT Received, exiting...")
+ process.exit(0)
+})
+
+// Handle SIGTERM
+process.on('SIGTERM', () => {
+ console.info("SIGTERM Received, exiting...")
+ process.exit(0)
+})
+
const parser = require('ua-parser-js');
const { uniqueNamesGenerator, animals, colors } = require('unique-names-generator');