Adds support for zeroconf (Bonjour)

This commit is contained in:
2025-05-30 20:12:53 -07:00
parent 3552c9c476
commit 1bde92b974
4 changed files with 92 additions and 1 deletions

View File

@@ -295,12 +295,18 @@ app.get("*", (req, res) => {
const port = process.env.PORT || 3000;
const server = app.listen(port, () => {
console.log(`Server is running on port ${port}`);
// Start zeroconf service advertisement
mediaPlayer.startZeroconfService(Number(port));
});
// Add graceful shutdown handling
const shutdown = async () => {
console.log('Received shutdown signal. Closing server...');
// Stop zeroconf service
mediaPlayer.stopZeroconfService();
server.close(() => {
console.log('Server closed');
process.exit(0);