Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

298
Visualizações
Can I read from an .env file in Javascript?

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?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda