S
S
Shrt2016-11-27 19:23:31
JavaScript
Shrt, 2016-11-27 19:23:31

How to leave blog posts/topic comments without reloading the page using node.js/express?

Hello! I just want to know which way to look, and what technologies to use. So, a blog on Node.js/Express, a user creates a topic, other users can leave comments and posts to this topic. What is the solution in node.js that will fast posts in real time without reloading the page? I’m still a beginner and I haven’t quite figured out the same web sockets, is there a reason to look there or is it still more for chat and real-time communication than for blog-like services? Thank you all for your attention and replies!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly, 2016-11-27
@Shrt

If you need to update your comments - sockets are not needed. An http request is sent to add a comment, a response is expected, with status 200 we add a new entry on the page. This all happens in the browser, node.js has nothing to do with it. If you need to update other people's comments in real time, then sockets are indispensable. I advise you to start with socket.io , there is everything you need for a quick start.

A
Artur Zayats, 2016-11-27
@zag2art

In its basic form, these are, of course, web sockets, but you will have to implement the logic yourself. Have a look at sharedb ( https://github.com/share/sharedb) it's a much more advanced thing for syncing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question