top of page
![](https://static.wixstatic.com/media/11062b_bcbd249e179746c78fdfde283fce1253f000.jpg/v1/fill/w_100,h_56,al_c,q_80,usm_0.66_1.00_0.01,enc_auto/11062b_bcbd249e179746c78fdfde283fce1253f000.jpg)
![Trax Logo](https://static.wixstatic.com/media/87c559_abfcb22bb2e346d49ee42cf4630101d6~mv2.png/v1/crop/x_0,y_0,w_356,h_354/fill/w_356,h_354,al_c,q_85,enc_auto/87c559_abfcb22bb2e346d49ee42cf4630101d6~mv2.png)
const express = require('express'); const dlna = require('node-dlna'); const app = express(); const port = 3000; // Discover DLNA/UPnP devices function detectReceivers() { return new Promise((resolve, reject) => { dlna.discover((err, devices) => { if (err) { reject(err); } else { resolve(devices); } }); }); } // API endpoint to get the list of detected devices app.get('/devices', async (req, res) => { try { const devices = await detectReceivers(); res.json(devices); } catch (error) { res.status(500).json({ error: error.message }); } }); // Start the server app.listen(port, () => { console.log(`Server is running on port ${port}`); });
bottom of page