add websocket counter plate

This commit is contained in:
2026-01-12 22:48:27 -03:00
parent a62acdc47d
commit 000009595d
3 changed files with 40 additions and 8 deletions

View File

@@ -329,6 +329,22 @@ app.post('/api/detect', async (req, res) => {
}
});
// Dataset Capture Notification (from ALPR Python)
app.post('/api/dataset/capture', (req, res) => {
const { plate_number, filename, count } = req.body;
console.log(`📸 Dataset capture: ${plate_number} (Total: ${count})`);
// Notify Frontend via WebSocket
io.emit('dataset_updated', {
plate: plate_number,
filename,
count,
timestamp: new Date()
});
res.json({ message: 'Notification sent' });
});
const bcrypt = require('bcryptjs');
const PORT = process.env.PORT || 3000;