vue-express-mongo-boilerplate
vue-express-mongo-boilerplate copied to clipboard
Server modules socket not implemented in core
In each of the server service, there is a socket object available, with functions like 'afterConnection'. 'afterConnection' never gets called because it is NOT loaded in the core service loading function in the /core/service.js.
Adding this snippet to the 'constructor' of /core/service.js function on line 141 seems to fix it:
// Handle sockets
if (schema.socket && _.isObject(schema.socket)) {
self.socket = {};
_.forIn(schema.socket, (socketfunc, name) => {
if (_.isFunction(socketfunc)) {
// Change action function to action object
self.socket[name] = socketfunc
}
});
}
Thanks. Please create a PR with fix.