JS Frontend & # 8596; C ++ backend communication (different servers)

I am working on a project that consists of a web font and a background service. The web interface is accessible to users and should interact with the background service, which is written in C ++, and works on (possibly in the future) another machine.

FYI: the background server (called the “backend” in the future) acts as an http server and listens for incoming requests on a specific port.

So far, the interface sends commands to the server with simple HTTP requests containing data in xml or json format.

Ok, now here is my problem: As the user enters data into the external interface, the interface expects that some data from the backend will display it to the user or use it inside our databases.

Can you recommend any ways to handle sending data from the backend to the external interface?

My current idea: The backend gets a link at startup, a kind of pingback url that it can call if there is any data to return to the interface. The called file enters the input data somewhere for storage, for example. memcache or mem-only databases. I plan to write an interface in javascript, possibly using a framework like Ember.js or Angular.js that can automatically handle such data updates internally. In any case, it should update the interface as soon as possible, using as few resources as possible.

Does my current approach work or is this purely stupid?

, : , - , ?

googled , , , Javascript frontend ↔ ++ backend communication, , , .

: ( ): , . , (). , .

(, , , ) , .

Padmak

+1
2
0

++ --, URL- ( - ), ajax , URL- . , angular.js ember.js .

, ajax, ember, angular.js "", Google.

, .

, angular, , $watch. ajax- , , - -, .

0

Source: https://habr.com/ru/post/1530661/


All Articles