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

Placement of .env file and linkage not working in 2-begin #513

Closed
AlekseiSaunders opened this issue Dec 21, 2022 · 3 comments
Closed

Placement of .env file and linkage not working in 2-begin #513

AlekseiSaunders opened this issue Dec 21, 2022 · 3 comments
Assignees

Comments

@AlekseiSaunders
Copy link

Using require('dotenv').config() as indicated in Chapter-2 did not work for me when .env file was placed in Root directory.
Needed to supply path in config() as so:
dotenv.config({ path: '../../.env' });
required dotenv in separate line as so:
const dotenv = require('dotenv'); - although don't know if it is necessary to split this and config.

@klyburke
Copy link
Member

@AlekseiSaunders Thanks for noting.

When you say "root directory", do you mean that your .env file is in the main builderbook folder, in the builderbook/book folder, or in the builderbook/book/2-begin (or 2-end) folder?

We set up the code to have a .env file within each of the begin and end folders. Try putting a copy of your .env file directly in your 2-begin or 2-end folder, then see if require('dotenv').config() works as expected.

@klyburke klyburke self-assigned this Dec 24, 2022
@AlekseiSaunders
Copy link
Author

AlekseiSaunders commented Dec 25, 2022 via email

@klyburke
Copy link
Member

You're welcome!

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