Answer the question
In order to leave comments, you need to log in
How to implement Content Loading in node.js?
Good day to all.
Let's admit there is a DB from where to the client posts of other people are issued. Clients opened a page whose content was loaded from the database. One of them changes the contents of the database (supplements it with his post). And HERE, immediately after changing the database, everyone should add posts without reloading the page, which were not on the client page.
-----------------------------------------
How to implement it? What to use? Socket.io?
Are there manuals on this topic?
Please, if you know, share your experience.
Answer the question
In order to leave comments, you need to log in
Take SSE (Server-Sent Events) or WebSockets in the implementation of socket.io or any other (these are just different wrappers, but there are two options), except for the obsolete long pooling aka commet, but who needs it on a node then. In the chat example you will find everything you need socket.io/get-started/chat or NPM search https://www.npmjs.org/browse/keyword/sse etc https://www.npmjs.org/ browse/keyword/websocket you can find a lot there, but https://www.npmjs.org/package/websocket and https://www.npmjs.org/package/sse are even easier there. If you want everything together on the same port and websocket and SSE and REST API and RPC API and web pages and statics, then see my https://github.com/tshemsedinov/impressand you can find articles on it on Habré, I have slides here on www.slideshare.net/tshemsedinov and examples are inside.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question