This article describes the green box in the figure, how Web Shop consumes microservices provided by Backend.
Open backend-MS Repository miniwebshop.html:
Var Socket = IO (‘ ws://127.0.0.1:8877 ‘);
Send an action named requestFromWebShop with an oData payload to the Web server via the socket.emit API.
The processing result of the background server can be received through socket.on.
The action name after the ON needs to be agreed between the front-end and back-end servers.
For more of Jerry’s original articles, please follow the public account “Wang Zixi “: