The location.hostname variable gives you the current host. That should be enough for you to determine which environment you are in.
if (location.hostname === "localhost" || location.hostname === "127.0.0.1")
alert("It's a local server!");
The location.hostname variable gives you the current host. That should be enough for you to determine which environment you are in.
if (location.hostname === "localhost" || location.hostname === "127.0.0.1")
alert("It's a local server!");