diff --git a/server/src/app.js b/server/src/app.js index 99302d9e7..8b2704252 100644 --- a/server/src/app.js +++ b/server/src/app.js @@ -163,3 +163,21 @@ export const startServer = async (overrideConfig = null) => { return returnMessage; }; + +export const shutdown = async () => { + console.log('Node service shutdown'); + + user.event('NODE', 'shutdown', 'requesting node shutfown').send(); + + // shutdown express server + server.close(); + + // shutdown OSC Server + shutdownOSCServer(); + + // shutdown OSC Client + oscClient.close(); + + // shutdown timer + global.timer.shutdown(); +};