简体   繁体   中英

In a node.js web app, is the only way for the client to communicate with the server through url routes?

I know using the Rest API the client can communicate with the backend anytime using URL routes. On page load you can use the route directly, and without reloading the page you can use ajax request. They both use URL routes to make a request to the server and the server handles it.

But is there any other way the client in a node.js web app communicates with the server?

您可以使用http://socket.io/在节点中轻松设置WebSocket通信,并以这种方式进行通信。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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