-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inject the request object from express ? #58
Comments
Figured how to do this.. (ngx-universal/express-engine provides both request and response) sorry about that.. |
@dr1ss it's ok, and glad that express-engine helped you with it 👍 Meanwhile, don't hesitate to ask when you have further questions. I'll try to help everyone as time allows me. |
Thank you @fulls1z3 , still new to the angular world.. and there is so many things to figure out, especially with Universal. |
@dr1ss don't worry all of us were new to this world some time ago, and if we talk about Angular there're really many things to learn, adapt and master on. Don't hesitate to ask questions when you're stuck with something. I'll try to answer and help as time allows. |
Hello guys,
I'm struggling to do something pretty simple : Grab the current hostname (domain name) and display it on a component. (I have multiple domain names pointing to the same application, so I need to get the hostname dynamically)
In a browser environment, I simply get it with document.location.hostname but since I'm using Universal, there is no such thing as document in a server environment.
So logically to achieve this, I will need to interact with nodejs request object and this is my question : Is there any way to inject the request and the response in Angular so I can get this kind of informations ?
I know it's possible with nguniversal/express-engine using Tokens (https://github.com/angular/universal/blob/master/modules/ng-express-engine/tokens.ts)
but I don't know if there is any way to achieve this with ngx-universal/express-engine
If anyone can help me with this please :)
The text was updated successfully, but these errors were encountered: