This project was generated using Angular CLI version 20.3.5. After the bootstrapping of the Angular CLI, we enabled server side rendering, added a component to a route that catches all requests and added illustrative code in the app.ts with an httpClient request and some logging.
To start a local development server, run:
ng serve
Once the server is running, open your browser and navigate to http://localhost:4200/
. The httpClient will request the http://localhost/assets/example.json on the server.
But when you request http://localhost:4200//someotherdomain it will the http://someotherdomain/assets/example.json url. The console on the server will illustrate what Angular thinks the hostname
is an the location.document.location.href
.