--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/b308485f-73c6-4889-8c91-27d031c55994%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
moodule.exports = function(app){
// code goes here
return; // don't forget to return because it's syncronous
}
module.exports = function(app, callback){
// same code goes here
callback(err); // callback has an error param in case of error
}
app.on('started', function() {});
module.exports = function(app) {
app.on('started', function() { console.log(app.io)
app.io.on('connection', function(socket){ console.log('a user connected'); var received = ['welcome to the chat']; socket.emit('message', { message: received });
socket.on('send', function (data) { received.push(data.message); console.log('received', received) socket.emit('message', {message : received}); });
socket.on('disconnect', function(){ console.log('user disconnected'); }); }); });}