vue-express-mongo-boilerplate icon indicating copy to clipboard operation
vue-express-mongo-boilerplate copied to clipboard

Server modules socket not implemented in core

Open XaroRSA opened this issue 7 years ago • 1 comments

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
			}
		});
	}

XaroRSA avatar Nov 16 '17 19:11 XaroRSA

Thanks. Please create a PR with fix.

icebob avatar Nov 16 '17 21:11 icebob