Додані повідомлення та перепрацьована структура застосунку та api
This commit is contained in:
@@ -2,16 +2,9 @@ const { updateApartment } = require("../services/apartments.service");
|
||||
const { updateBuilding } = require("../services/buildings.service");
|
||||
const { lockingStand, unlockingStand, updateStand } = require("../services/stand.service");
|
||||
const { broadcast } = require("../utils/broadcaster");
|
||||
const { pushToMetrics } = require("../middleware/pushToMetrics");
|
||||
|
||||
module.exports = async (wss, ws, message) => {
|
||||
try {
|
||||
pushToMetrics({
|
||||
type: "ws_out",
|
||||
length: message.length,
|
||||
timestamp: Date.now()
|
||||
});
|
||||
|
||||
switch (message.type) {
|
||||
case "apartment":
|
||||
await updateApartment(ws.user, message.data);
|
||||
|
||||
Reference in New Issue
Block a user