Adds support for zeroconf (Bonjour)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user