Open guicouto opened 7 years ago
Is it possible to integrate socket.io and node-orm2?
What I actually want is use this way:
1) Create a connection global: In my server.js create a global connection, as I do using express, but in express I call in req
server.js
req
2) Inside socket.io, for example
socket.on('send_message', function(socket){ orm_global.db.models.messages.create({ message: my_message_var, date: new Date(), }); });
PS: I'm using MySQL.
Thanks in advance. Guilherme Couto
Is it possible to integrate socket.io and node-orm2?
What I actually want is use this way:
1) Create a connection global: In my
server.js
create a global connection, as I do using express, but in express I call inreq
2) Inside socket.io, for example
socket.on('send_message', function(socket){ orm_global.db.models.messages.create({ message: my_message_var, date: new Date(), }); });
PS: I'm using MySQL.
Thanks in advance. Guilherme Couto