K
K
Kotaro Hiba2020-06-29 13:22:49
Node.js
Kotaro Hiba, 2020-06-29 13:22:49

Is this method of updating messages correct?

I am making a small application that will allow me to chat with a user in VK.
I use NodeJS + express (server), Vue (front)
At the moment I'm implementing a dialog with another user and there are some problems, I don't know how to dynamically receive data from VK about the dialog.
During launch, there are no problems, they poked at the user, sent 1 get request, received all the messages of the dialog, but what to do with active correspondence, I don’t know.
I'm thinking of making a loop that will send a GET request every 1-2 seconds while the dialog box is open, but I think this is a crutch, so I wanted to know how you implement such things.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-06-29
@lina666

If there are no alternatives from the server side (websocket or at least old-fashioned long polling), then just gouge.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question