IO-2924-Refactor-Production-board-to-use-Socket-Provider: Finalize

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-09-26 10:56:48 -04:00
parent 328a64eb90
commit 932f572fb5
7 changed files with 127 additions and 89 deletions

17
server/utils/ioHelpers.js Normal file
View File

@@ -0,0 +1,17 @@
const applyIOHelpers = (app, api, io, logger) => {
const getBodyshopRoom = (bodyshopID) => `broadcast-room-${bodyshopID}`;
const ioHelpersAPI = {
getBodyshopRoom
};
// Helper middleware
app.use((req, res, next) => {
req.ioHelpers = ioHelpersAPI;
next();
});
return ioHelpersAPI;
};
module.exports = applyIOHelpers;