Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 596 Bytes

dotenv.md

File metadata and controls

29 lines (21 loc) · 596 Bytes
title description created updated
dotenv (Nodejs Library)
dotenv loads the environment variables from .env file to process.env
2019-06-21
2019-06-21

dotenv loads environment variables from .env file to process.env

Installation

npm install dotenv

Usage

Add the folllowing line in the beginning of your Node application. This loads the environemnt variables from .env file to process.env

require('dotenv').config()

.env file syntax

APPLICATION_PORT=8080

once this is defined you can access using process.env.APPLICATION_PORT