In vanilla Javascript intepreted in the browser, we can get the hostname using:
window.location.hostname
So, how can I get the same with Javascript running in the server, using Node.js/Express.js?
Better, I need to dynamicly generate URLs to serve static files. How is the best way to attach the hostname to the file path of the files in my Express static file server?
Kind Regards.