I have an issue when trying to get request domain name on server. But sometimes i will show an IP and sometimes it will show correct domain name. How can i get only the domain when ever i request to server ? Can you guys help me in this ? Thank you guys.
app.get('*', (req, res) => {
const host = req.headers.host;
console.log("Host ",req.headers.host)
})