DEV Community

Discussion on: Angular Standalone in SSR: update

Collapse
 
ayyash profile image
Ayyash

you can inject the REQUEST in the service and get req.headers('host') like this:
garage.sekrab.com/posts/loading-ex...

Or you can provide it from NodeJs into its own variable and inject the variable itself
garage.sekrab.com/posts/loading-ex...

constructor(
    // inject our serverURL
    @Optional() @Inject('serverUrl') private serverUrl: string
  ) {}
Enter fullscreen mode Exit fullscreen mode