简体   繁体   English

如何从 .net core 或 express 后端获取通知以响应 js 前端?

[英]How to get notifications from .net core or express backend to react js frontend?

I'm using fetch() in javascript to fetch data from my .net core backend (will later be replaced with node and express) to my react js front end.我在 javascript 中使用 fetch() 从我的 .net 核心后端(稍后将被 node 和 express 替换)获取数据到我的 react js 前端。 With this I can do stuff like http GET and POST, etc. But I need to also be able to get notifications/send messages from the backend when something changes.有了这个,我可以做诸如 http GET 和 POST 之类的事情。但我还需要能够在发生变化时从后端获取通知/发送消息。 I assume I need to use something else.我想我需要使用其他东西。 What do you recommend?你有什么建议吗? SignalR?信号R? Something else?还有什么?

What ur looking for would be real-time communication你想要的是实时通信

For Node/Express I'd recommend Socket.IO https://socket.io/对于 Node/Express 我推荐 Socket.IO https://socket.io/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM