Skip to main content

Posts

Showing posts with the label http

Let's create simple LoadBalancer Server - Node JS

Load Balancer is server that refers to process of distributing a set of tasks over set of a resources. prerequisite 1. Node Creating the simple http web server. Server 1 Server 2 Creating the simple load balancer module. Load Balancer Output:

Interceptors in Angular - Adding custom headers in all http request.

Intercepting requests and responses From Angualr Docs "With interception, you declare interceptors that inspect and transform HTTP requests from your application to a server. The same interceptors can also inspect and transform a server's responses on their way back to the application. Multiple interceptors form a forward-and-backward chain of request/response handlers. Interceptors can perform a variety of implicit tasks, from authentication to logging, in a routine, standard way, for every HTTP request/response. Without interception, developers would have to implement these tasks explicitly for each HttpClient method call." Multiple interceptors Example : Adding custom headers in all http request. Example code on github Run the code in stackblitz File Structure: Code: Output: The header will be added in all http request.