« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/write
diff options
context:
space:
mode:
Diffstat (limited to 'src/write')
-rw-r--r--src/write/build-modes/live-dev-server.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index a2a84a89..24e18320 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -474,10 +474,15 @@ export async function go({
   if (skipServing) {
     logInfo`Ready to serve! But --skip-serving was passed, so all done.`;
   } else {
-    server.listen(port, host);
+    process.on('SIGINT', () => {
+      process.stdout.write('\n');
+      server.close();
+    });
 
-    // Just keep going... forever!!!
-    await new Promise(() => {});
+    await new Promise(resolve => {
+      server.listen(port, host);
+      server.on('close', () => resolve());
+    });
   }
 
   return true;