Local Node Environment Variables with DotEnv

preview_player
Показать описание
API Keys and such should never be checked in to source control, so you need some way to inject them into your application when running locally. In this video, we will use the DotEnv NPM package to add local environment variables to a Node project.

### Website

### Course Links

### Subscribe to the Learn.Build.Teach. Newsletter

### Social Media

### Website

### Subscribe to the Learn.Build.Teach. Newsletter

### Social Media
Рекомендации по теме
Комментарии
Автор

What is in the Package.json file inside? This does not work under Windows. Too bad that you do not provide the whole code on Github.

MrLion
Автор

I don't understan how to use easly this in functions of netlify... to hide private key of api

Viralplace
Автор

How about also keeping the prod.env file having all the production configuration onto the production host machine itself. That way we can be sure of this file not available in version control and a single file load could load all the local environment variables? Does this sound good?

SaurabhKumar-fbxj
Автор

I made an app with "create-react-app"
ran the "npm install dotenv"
created the .env in the root directory
put in App.js
and then made a Console.log(process.env.PORT) in a App.js function


but is still write down "undefined'


Do you know how can I make it work ?

ivandres
Автор

worked on next.js and nodejs Thank you !!! :)

Zerowolrd
Автор

MY files are not recognizing my environment variables

JB-ucvf