Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dotenv-expand instead of dotenv #405

Closed
AnandChowdhary opened this issue Oct 31, 2020 · 2 comments
Closed

Use dotenv-expand instead of dotenv #405

AnandChowdhary opened this issue Oct 31, 2020 · 2 comments

Comments

@AnandChowdhary
Copy link

AnandChowdhary commented Oct 31, 2020

I'm submitting feature request

We should use dotenv-expand instead of dotenv.

Instead of this:

import { config } from 'dotenv';
config();

We should do this:

import { config } from 'dotenv';
import dotenvExpand from 'dotenv-expand';
dotenvExpand(config());

Current behavior

We use dotenv to fetch configuration from the .env file

Expected behavior

We should switch to using dotenv-expand

What is the motivation / use case for changing the behavior?

Using dotenv-expand, we can do this:

DB_PROVIDER = "my-database-provider"
DB_USER = "my-database-user"
DB_PASSWORD = "my-database-password"
DB_HOST = "my-database-host"
DB_POST = 3306
DB_NAME = "my-database-name"
DATABASE_URL = "${DB_PROVIDER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_POST}/${DB_NAME}"

Currently, we'd have to specify the full DATABASE_URL.

@kamilmysliwiec
Copy link
Member

@AnandChowdhary
Copy link
Author

Oops, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants