Skip to content

process.env variables are not read from .env #11

@ahaus

Description

@ahaus

My variables defined in .env were not read. The solution I found was using the npm package dotenv.

To fix this:
I added the statement below at the beginning of app.js to load the variables in .env
require('dotenv').load();

I added the dependency into package.json (or install with npm install --save dotenv).
"dotenv": "^1.2.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions