如何在MERN应用中正确设置IO?
我是socket.io的新手。我对它的工作原理有基本的了解,但是我正在努力在MERN应用程序中找到适当的设置。如果有任何文章或指导您可以给我,我将对其进行处理。我正在构建社交网络应用程序,我需要有实时通知和消息。因此,我不确定如何在React中设置socket.io客户端。我应该像Express一样在Helper File中实现它,还是还有其他方法?谢谢
I am new to socket.io. I have basic understanding of how it works, but I am struggling to find proper setup for it within MERN app. If there is any article, or guidance that you can give me, I would appretiate it. I am building social network app, and I need to have live notifications and messages. So I am not sure how to setup socket.io client in react. Should I instanciate it in helper file, like mongoose in express, or is there any other way? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
START socket.io-客户端应用程序应用程序
import import socket.io在服务器页面
客户端代码可能看起来像这样
Install socket.io - client for client app
import socket.io in server page
Client side Code May look like this