Learn DOTENV in 6 minutes

Поділитися
Вставка
  • Опубліковано 19 гру 2024

КОМЕНТАРІ • 62

  • @CodeWithVlad
    @CodeWithVlad  3 роки тому

    I hope you loved this video! 🙂
    📮Consider subscribing to my newsletter: codewithvlad.substack.com
    🔥 And follow me on Twitter: twitter.com/vladimir_agaev

  • @ЕкатеринаЗданевич-ы2х
    @ЕкатеринаЗданевич-ы2х 6 місяців тому

    Низкий тебе поклон, чувак. Спасибо!) Твоё видео это та самая жемчужина на просторах интернета

  • @rincogamer6484
    @rincogamer6484 2 роки тому

    Thanks vlad i passed trough 10 videos before coming here and just u explained what i need

  • @hank91918
    @hank91918 3 роки тому +4

    Thanks Vlad!! Finally, nobody else in other "tutorials" bothered mentioning you have to install the damned package dotenv package before you can use the env file, lol! Great tutorial, thanks again!

  • @Uran.Khatola
    @Uran.Khatola Рік тому

    Accurate and to the point! Very nice video!

  • @kalyanchatterjee8624
    @kalyanchatterjee8624 3 роки тому +2

    Liked and subscribed. This type of video is ideal for professional developers! I wanted to learn (quickly) how to use dotenv (over config) for storing variables for different environments. Your tutorial helped a lot!

  • @MiSt3300
    @MiSt3300 3 роки тому +2

    Short and to the point! Thanks!

  • @schantin
    @schantin Рік тому

    Thanks, implemented in our project with your help.

  • @The.SpiritualScientist
    @The.SpiritualScientist 2 роки тому

    Precisely crisp and clear!! That's what is a perfect coding tutorial should be like. 👍👍 Liked and subscribed.

  • @nikhil182
    @nikhil182 2 роки тому

    Crystal clear explanation!! Thank You Brother!!

  • @Aliena92
    @Aliena92 2 місяці тому

    Very clear! Thank you!

  • @Gordo_de_pradera
    @Gordo_de_pradera 2 роки тому +1

    thanks you so much Vlad, u are so quickly to explain .env

  • @ahme585
    @ahme585 3 роки тому +1

    Thanks so much
    very straight forward and easy
    many thanks

  • @ConorBailey
    @ConorBailey 3 роки тому +1

    Great video vlad. Thanks!

  • @omerfaran8514
    @omerfaran8514 2 роки тому

    Excellent tutorial thanks a lot!

  • @CodeWithVlad
    @CodeWithVlad  4 роки тому +1

    Hey guys, if you liked this video please subscribe to my channel here: ua-cam.com/channels/jmouj0JizYt0qTI53TAtFg.html
    It will help me to make more tutorials!

  • @Tom-vr5yv
    @Tom-vr5yv 3 роки тому

    Gorgeous explanation!

  • @clickadelic7681
    @clickadelic7681 Рік тому

    Thank you so much for this

  • @heyOrca2711
    @heyOrca2711 7 місяців тому

    Thank you Vlad!

  • @clydegrey5060
    @clydegrey5060 4 роки тому +1

    Nice content Vlad. Really informative.

  • @dweebycat9929
    @dweebycat9929 2 роки тому

    Thank you so much!!

  • @sidhant500
    @sidhant500 3 роки тому

    Great explanation…

  • @forsmtp5139
    @forsmtp5139 3 роки тому +1

    awesome explanation.
    wanna ask, if you deploy to UAT or etc, should the .env copy to the server?

    • @CodeWithVlad
      @CodeWithVlad  3 роки тому

      .env should be on the server but not in your repository if that makes sense.

  • @magedahmed5981
    @magedahmed5981 4 роки тому

    what is the theme that you use for the VSCode ? and how did change the Terminal fonts and colors ..?

    • @CodeWithVlad
      @CodeWithVlad  4 роки тому

      The theme is material ui, with material icons :)

    • @CodeWithVlad
      @CodeWithVlad  4 роки тому

      And terminal is ohmyz.sh/

  • @yummybunny7351
    @yummybunny7351 4 роки тому +1

    What VsCode theme you use?

  • @gerryjtierney
    @gerryjtierney 3 роки тому +4

    Is there anyone anywhere who can tell us how to do this with ES6 modules?

  • @archibald-yc5le
    @archibald-yc5le Рік тому

    What are the advantages of building with dotenv vs building with envs in docker compose?

  • @learningjoe1823
    @learningjoe1823 2 роки тому

    How can I change the environment variables from database query ?

    • @CodeWithVlad
      @CodeWithVlad  2 роки тому

      Dotenv is just a library that will load the environment variables from a file (.env) into the memory of your app. You will have to be more specific with your question though as I don't know which database and which environment you want to use.

  • @ygvanz
    @ygvanz 3 роки тому

    Is there a way to update an existing env variable, for example an access token?

    • @CodeWithVlad
      @CodeWithVlad  3 роки тому

      yes, process.env.VARIABLE = value;

  • @jonathanb2411
    @jonathanb2411 2 роки тому

    Tres clair, merci

  • @ayinlaoluwafemi1993
    @ayinlaoluwafemi1993 4 роки тому

    keep up the good work Vlad. Please how am I going to require dotenv in a file which is in a nested folder.

    • @CodeWithVlad
      @CodeWithVlad  4 роки тому

      3:54, add your nested folder just after the __dirname

    • @ayinlaoluwafemi1993
      @ayinlaoluwafemi1993 4 роки тому

      @@CodeWithVlad I'm still having a little bit of challenge, I tried requiring the dotenv in a nested file "formHandler.js" but didn't work. i.e the path to the file is src/client/js/formHandler.js. My code is : const path = require('path'); const apiKey = require("dotenv").config({
      path: `${__dirname}/.env.${process.env.API_KEY}`
      });. Please help

    • @ayinlaoluwafemi1993
      @ayinlaoluwafemi1993 4 роки тому

      my outputs are undefined

    • @CodeWithVlad
      @CodeWithVlad  4 роки тому +1

      @@ayinlaoluwafemi1993 you would do something like that const apiKey = require("dotenv").config({
      path: path.resolve(__dirname, '../../../', `.env.${process.env.API_KEY}`)
      }); If you still have a problem post your github link

  • @andrewberrio7374
    @andrewberrio7374 Рік тому

    hi everyone if you are here for a react app don't install it it is already there create the .env and puti it in a .gitignore file as .env
    call it as the video without requiere it .

  • @hendrichristianto310
    @hendrichristianto310 Рік тому

    in windows for node_env=development is not working, why ?

  • @rdamasceno99
    @rdamasceno99 2 роки тому

    I am getting an error when don't provide NODE_ENV.
    Dont know if anyone used it with JEST
    TypeError: Cannot read properties of undefined (reading 'address')
    16 |
    17 | const response = await request(process.env.cognitoBaseUrl)
    > 18 | .post("/")
    | ^
    19 | .send(JSON.stringify(constants.adminLoginBody))
    20 | .set("Content-Type", "application/x-amz-json-1.1")
    21 | .set("Connection", "Close")
    at Test.serverAddress (node_modules/supertest/lib/test.js:46:22)
    at new Test (node_modules/supertest/lib/test.js:34:14)
    at Object.post (node_modules/supertest/index.js:28:14)
    at Object.generateUserTokens (newWorldSetup.js:18:12)
    at jest.setup.js:11:23

  • @ivanhsiaolung2178
    @ivanhsiaolung2178 3 роки тому

    if we create env , is secure ? running on apk ? i have .env encrypt, running login success on simulator but not working on apk

  • @zolisawelani9338
    @zolisawelani9338 2 роки тому +1

    Succinct explanation.

  • @nikkis8102
    @nikkis8102 2 роки тому

    This is a really dumb question but what's the point if you have to have a .env file there that has your .env-variables (e.g. password) exposed anyways?

  • @a_b_p97
    @a_b_p97 4 роки тому

    How are you able to use multiple .env files?

  • @DemiZhao-pi7qp
    @DemiZhao-pi7qp Рік тому

    nice!

  • @ahmedelsehrawy3809
    @ahmedelsehrawy3809 2 роки тому

    someone tell me how to make the terminal autocomplete for me like in the video what the hack ?!

  • @lismai9906
    @lismai9906 3 роки тому

    APPLE COMPUTER = WINDOWS USERS following this tutorial will be at a loss and say "why mine doesnt work with NODE_ENV=development"
    Windows user will be lost when NODE_ENV=development
    Must npm install cross-env
    then in package.json "buildDev": "cross-env NODE_ENV=development node server" //assuming u have ".env.development" file and "server.js" is the target file