套接字io将数据插入表Azure Mobile App Node.js
我正在使用套接字io、Azure移动应用程序和Azure数据库,套接字io将把我的消息保存到Azure数据库套接字io将数据插入表Azure Mobile App Node.js,node.js,azure,azure-sql-database,azure-mobile-services,Node.js,Azure,Azure Sql Database,Azure Mobile Services,我正在使用套接字io、Azure移动应用程序和Azure数据库,套接字io将把我的消息保存到Azure数据库 io.sockets.on('connection', function (socket) { socket.on('send_message', function (data) { console.log(data); c.saveMessage(data); }); } 但据我所知,azure移动应用
io.sockets.on('connection', function (socket) {
socket.on('send_message', function (data) {
console.log(data);
c.saveMessage(data);
});
}
但据我所知,azure移动应用程序必须使用req.azureMobile与数据库通信,因此我不知道如何将请求传递给socket io或创建可以与数据库通信的上下文
我必须使用req.azureMobile与数据库通信,因此我不知道如何将请求传递给socket io或创建可以与数据库通信的上下文
对于您的要求,我在我这边检查了一下,并尝试按照可能的方法来满足您的要求,但最终没有运气
根据您的要求,我假设您可以遵循以下方法:
- 只需利用Azure Mobile Apps中间件公开并显式调用相关的表端点即可保存消息
- 使用其他软件包(例如)并编写SQL语句以直接与SQL Server数据库通信。你可以关注细节