Files
DRBv3/server/addons/example/index.js
Logan Cusano bee95ed999 #6
- Added a config system to the addons
- Added options in the config for dynamic variables
- Updated example and code to use new config and options
2024-03-10 04:50:16 -04:00

18 lines
594 B
JavaScript

// addons/addon1/index.js
// Function called by the main application to initialize the addon
export function initialize(nodeIo, config) {
console.log(`Initializing ${config.name}`);
// Call other functions within the addon module
registerSocketEvents(nodeIo, config);
// Call additional initialization functions if needed
}
// Function to register Socket.IO event handlers
function registerSocketEvents(nodeIo, config) {
nodeIo.on(config.options.eventName, (data) => {
console.log(`Received event "${config.options.eventName}" from client:`, data);
});
}