فهرست منبع

Gestion des Ctrl+C

Arthur Brandao 5 سال پیش
والد
کامیت
23efc550e2
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      node/main.js

+ 6 - 0
node/main.js

@@ -1,5 +1,11 @@
 #!/usr/bin/env node
 
+// Gestion du signal d'arret (SIGINT = Ctrl+C)
+process.on('SIGINT', function() {
+    console.info("\nStopping the server");
+    process.exit();
+});
+
 // Gestion des commandes et des options de l'application
 const argv = require('yargs')
     .command('serve [port]', 'start the Loquicompta server', (yargs) => {