-
Notifications
You must be signed in to change notification settings - Fork 2
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
does not get loaded #1
Comments
Hey @koraysels, the hook should run during the sails initialization which should be early enough yeah. Do you have an example of when you're trying to access the loaded values? (from a model / controller method etc). Cheers |
I am having this same issue. From package.json:
From config/dotenv.js: From ./.env: From config/connections.js: Prints:
|
OK I see what is happening here. Sails Lifecycle confirms that config variables are loaded before hooks, so any database variables set in config/connections.js will be loaded before this hook is called. A suggested quick-fix for anyone coming behind me: just add |
@jpdavy, I believe it should be |
@vishthemenon |
Where ever you use the process.env.YOURVAR, insert |
hi I installed sails-hoos-dotenv and added config in /config but it does not load my .env file..
I use it for my db credentials etc.. is it possible the hook gets fired too late ? It should be loaded as early as possible right ?
The text was updated successfully, but these errors were encountered: