'Express get request host [duplicate]

I am trying to get the request host name on express but on the server it gets 0.0.0.0 or server host name. I am trying this to allow only request that comes from my front page web.

Is there a secure way to get the real one and the user cannot change it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source