12 lines
401 B
JavaScript
12 lines
401 B
JavaScript
import { broadcast } from './ws.js';
|
|
|
|
const handlers = {
|
|
updateLocation(req, res) {
|
|
const { name, latitude, longitude, timestamp } = req.body;
|
|
console.log(`Received location: (${name}, ${latitude}, ${longitude}) at ${timestamp}`);
|
|
broadcast("update-location", { name, latitude, longitude, timestamp });
|
|
res.json({ success: true });
|
|
}
|
|
}
|
|
|
|
export default handlers; |