Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 712 Bytes

File metadata and controls

28 lines (17 loc) · 712 Bytes

DOTENV

DESCRIPTION

EXAMPLE OF NODE.JS USING:

  • DOTENV: A PACKAGE TO DEFINE ENVIRONMENT VARIABLES.

RECOMMENDED VSCODE EXTENSIONS

INSTALL THE DOTENV VSCODE EXTENSION.

REQUIRED PACKAGES

npm install dotenv

CONFIGURATIONS

  • CREATE .env FILE. THIS FILE WILL CONTAIN ENVIRONMENTAL VARIABLES AVAILABLE THROUGH process.env.variablename.
  • IF YOU ARE USING GIT, ADD .env AS A NEW LINE IN .gitignore (GOOD PRACTICE).

EXAMPLE

npx nodemon ./folderSource/folderTopics/folderDotenv/exampleDotenv.js