const express = require('express'); const app = express(); const port = 3000; app.use(express.json()); app.use(express.static('public')); let testResults = []; // Endpoint for the HDMI Tester to upload results app.post('/api/results', (req, res) => { const { deviceId, mode, results } = req.body; const testId = testResults.length + 1; const timestamp = new Date().toISOString(); const newEntry = { testId, deviceId, mode, timestamp, results }; testResults.push(newEntry); console.log(`Received test #${testId} from ${deviceId}`); res.status(201).json({ status: 'success', testId }); }); // Endpoint for the Web Interface to get all results app.get('/api/results', (req, res) => { res.json(testResults); }); app.listen(port, () => { console.log(`HDMI Tester Server running at http://localhost:${port}`); });