concept Node server in category angular

appears as: Node server, Node servers
Angular Development with Typescript, Second Edition

This is an excerpt from Manning's book Angular Development with Typescript, Second Edition.

Figure 12.9. Retrieving all products from the Node server via proxy

We’ll start this chapter with a brief comparison of HTTP and WebSocket protocols, and then we’ll show you how a Node server can push data to a plain web page and to an Angular app.

13.2. Pushing data from a Node server to a plain client

WebSockets are supported by most server-side platforms (Java, .NET, Python, and others). In chapter 12, you started working with Node servers, and you’ll continue using Node for implementing your WebSocket server. In this section, you’ll implement one particular use case: the server pushes data to a browser client as soon as the client connects to the socket. Since either party can start sending data over the WebSocket connection, you’ll see that WebSockets aren’t about request/response communication. Your simple client won’t need to send a request for data—the server will initiate the communications.