#6 The bones
- Added a module to load addons - Added an example module that just extends the socketIO connection to add an console log
This commit is contained in:
17
server/addons/example/index.js.ex
Normal file
17
server/addons/example/index.js.ex
Normal file
@@ -0,0 +1,17 @@
|
||||
// Function called by the main application to initialize the addon
|
||||
export function initialize(io) {
|
||||
console.log('Initializing addon1');
|
||||
|
||||
// Call other functions within the addon module
|
||||
registerSocketEvents(io);
|
||||
// Call additional initialization functions if needed
|
||||
}
|
||||
|
||||
// Function to register Socket.IO event handlers
|
||||
function registerSocketEvents(io) {
|
||||
io.on('connection', (socket) => {
|
||||
console.log('A client connected from addon1');
|
||||
|
||||
// Add more event handlers if needed
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user