I'm not using using Node or anything like that, just pure Javascript. I want to read a value that is located in an .env file and display that value on my HTML page. I was able to use the following code to read from a json file that I created, but it would be great if I could reuse the .env file I already have so that I don't have to duplicate the information.
fetch("settings.json")
.then(response => response.json())
.then(json => {
document.getElementById("project-name").innerHTML=json["project-name"];
});
If I replace my settings.json file with my .env file this doesn't work because it can't find the file (yes I double checked the location). Any tips?