I want to have a check in my javascript if the page loading up is on my local machine.
The reason why I want to do that is that when I developing I like to make sure
const LOCAL_DOMAINS = [ "localhost", "127.0.0.1" ]; /* offline || development */ if ( LOCAL_DOMAINS.includes(location.hostname) ) { BASE_URL_PUBLIC = location.hostname + "/folder/website/"; // your project folder } /* online || production */ else { BASE_URL_PUBLIC = location.hostname; }