IO-2924-Refactor-Production-board-to-use-Socket-Provider: Finalize
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
17
server/utils/ioHelpers.js
Normal file
17
server/utils/ioHelpers.js
Normal 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;
|
||||
Reference in New Issue
Block a user