Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

465
Vistas
.env file variables are unable to read

my (.env file) variables are not reading in Nestjs, how do I format it in my VSC editor to execute it. Appreciate anybody could help or advise on this. Thank you guys

PORT="3000"
API_PREFIX="/api/v1"

#Rabbit MQ
RABBITMQ_CONN_STRING="amqp://guest:guest@localhost:8888/"
RABBITMQ_Q_NAME="hcert-root-message"
# DB
MONGO_URL ="mongodb://localhost/jcerts-backend"

# Passport-JWT
JWT_SEC="kepler-jwt-secret"

# Mailer
AWS_ACCESS_KEY_ID= #
AWS_SECRET_ACCESS_KEY= # AWS key for SES
BASEURL= "http://localhost:3000"

# Smart Contracts

#ropsten infura
PROVIDER_HTTP= https://ropsten.infura.io/v3/63de3b382a7c4d30954ed8bf912xxxxx
INFURA_VERSION="v3"
INFURA_ID="63de3b382a7c4d30954ed8bf91xxxxx"

# OTP Required
OTP_REQUIRED_SIGN_IN = false
OTP_REQUIRED_SIGN_UP = true
OTP_REQUIRED_SIGNING = true
OTP_REQUIRED_NOAISSUE = true

# Wallet ropsten                 
WALLET_PRIV = "e70694578f637de71fc4dcd68a1d4ba418db6ebc61f9072ea52e4bxxxxxxxxx"
WALLET_ADDR = "0xEB8EaC9396267DEbe493fFc80xxxxxxxxx"

VALUE = "0.5"
GAS_PRICE_PREMIUM_PCT="10"
GAS_LIMIT="70000"
GAS_LIMIT_DOCSTORE="1500000"
ISSUEDOC_NETWORK = "ropsten"

# ropsten
DOCSTORE_FACTORY="0xb539d81F709b23D1039A19596AA19xxxxxxxxxx"  

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Click at the bottom where it says JSON

enter image description here

Type in env and select Environment Variables

enter image description here

You also need to update your env file:

  • Don't use quotes
  • Don't have spaces around ='s

If for some reason this still isn't working or Environment Variables isn't an option, install this VS Code extension:

Name: ENV

Id: irongeek.vscode-env

Description: Adds formatting and syntax highlighting support for env files (.env) to Visual Studio Code

Version: 0.1.0

Publisher: Jakka Prihatna

VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=IronGeek.vscode-env

Finally, if all of this doesn't work, make sure your .env file is in the correct folder.

If Nestjs doesn't come with dotenv, you'll need to set it up yourself

about 4 years ago · Juan Pablo Isaza Denunciar

0

Check url param where i used env variable, by this way you can get and use variable value. it will help you out.

 var restaurants_id = 1;
    restaurants_name = "hello";
    restaurants_code = 2903483;
    $.ajax({
        type: 'post',
        url: ***'{{env("DB_HOST")}}',***
        data: {
            'restaurants_id': restaurants_id,
            'restaurants_name': restaurants_name,
            'restaurants_code': restaurants_code
        },
        success: function(data) {
            console.log(data);
            
        }
    });
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda