Search code examples
angularangular-universalserver-rendering

How could do some http requests just from the server side in Angular Universal


I'm implementing Angular Universal over an Angular project to hide some http requests, but in my research, I found that I can't hide those with the way provided by Angular. Did someone try to do the http request in the express engine an retrieve the data?

The target is a very large Angular 5 project (I know.. If I wanted to do the http requests from the server, I wouldn't use Angular but I didn't begin the project)

I applied the configuration recommended by Angular in this article: https://angular.io/guide/universal

I want to hide some requests from the client


Solution

  • You cannot. Only initial page will be rendered using angular universal; once that page is loaded the client side angular application takes over and then you've got SPA navigation, with ajax calls to your API.