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

Load variables from .env before requiring routes #583

Merged
merged 2 commits into from
Aug 15, 2018

Conversation

joelanman
Copy link
Contributor

Code in route.js may be looking for environment variables. If the environment variables aren’t loaded beforehand this will cause an exception.

I suspect this worked fine before bbe15e8#diff-78c12f5adc1848d13b1c6f07055d996e, which reordered the first lines in server.js.

This commit moves the loading of environment variables to before the requiring of any routes.js files.

quis and others added 2 commits August 15, 2018 12:24
Code in `route.js` may be looking for environment variables. If the environment variables aren’t loaded beforehand this will cause an exception.

I suspect this worked fine before bbe15e8#diff-78c12f5adc1848d13b1c6f07055d996e, which reordered the first lines in `server.js`.

This commit moves the loading of environment variables to before the requiring of any `routes.js` files.
@joelanman joelanman changed the title Load environment variables before requiring routes Load variables from .env before requiring routes Aug 15, 2018
@joelanman joelanman merged commit 2119937 into master Aug 15, 2018
@joelanman joelanman deleted the fix-loading-dotenv branch August 15, 2018 12:06
@joelanman joelanman mentioned this pull request Aug 15, 2018
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

Successfully merging this pull request may close these issues.

3 participants