Skip to content

Conversation

breynolds-dts
Copy link

Provides a way to run the server with a way to /shutdown/ the server by POST, because the swift app's NodeMobile doesn't provide a direct way to do so. The route is only enabled if a secret is passed in when starting the server, and the same secret is required to trigger the shutdown.

@breynolds-dts breynolds-dts requested a review from hobinjk-dts May 20, 2025 19:42

console.info('Authorized shutdown request received');
res.send('Shutting down server...');
exit();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may turn out that you want to use process.exit(0) here to circumvent the usual safe shutdown process

Copy link

@hobinjk-dts hobinjk-dts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better than /restartServer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants