I currently have the following in configuration for socket.io in my app.js file:
app
.configure(feathers.socketio(function(io){
io.on('connection', function(socket){
socket.emit('connect',{test: 'wow'});
socket.on('createRecord', function(socket){
analytics.service('record').create({type: socket.name, user: socket.interest}, function(error, user){
});
})
})
}))
The above works fine, but is there a way to separate the socket.io logic from the app.js, as it will get very large as I continue on adding more emit and on methods. I am aware this can be done by passing the socket object into as an argument into a module in another file and using it from there. However, I am not sure how to proceed with that in feathersjs.