top of page
Trax Logo

Welcome to Trax! 🙃Pick the Portal you'd like to travel down🙃 Experience endless content in each realm🙃Hit that chat button if you need help or have any questions🙃 Click me to start your free trial today!🙃

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