summary refs log tree commit diff
path: root/bundle/src/Server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'bundle/src/Server.ts')
-rw-r--r--bundle/src/Server.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts
index e461ec5f..c5da5fc9 100644
--- a/bundle/src/Server.ts
+++ b/bundle/src/Server.ts
@@ -22,6 +22,14 @@ const cdn = new CDNServer({ server, port, production, app });
 // @ts-ignore
 const gateway = new Gateway.Server({ server, port, production });
 
+//this is what has been added for the /stop API route
+process.on('SIGTERM', () => {
+	server.close(() => {
+		console.log("Stop API has been successfully POSTed, SIGTERM sent")
+	})
+})
+//this is what has been added for the /stop API route
+
 async function main() {
 	server.listen(port);
 	await initDatabase();