Reputation: 1
I am working with angular(12) universal and in the backend, using .net core 3.1.
My app is like crm. My question is taking company identifier from url.
Eg; my angular app url format is companyidentifier.myapp.com/rest_of_urls. I need to add subdomain information from angular app requests that are sent to server apis. I checked all states like headers (referer, origin or custom header), getting url information in server side. These are sent to SSR. When SSR try to render page, i couldn't see these headers or url information in the server side.
How can i able to share a data that can be used in SSR rendering? I need to update server api requests headers or something else during rendering.
Upvotes: 0
Views: 930
Reputation: 12357
The Angular docs recommend passing the URL through the options
param of renderModuleFactory
The recommended solution is to pass the full request URL to the options argument of renderModule() or renderModuleFactory() (depending on what you use to render AppServerModule on the server). This option is the least intrusive as it does not require any changes to the application.
From this tutorial on SSR in ASP you can see an example
Upvotes: 1