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

Environment config support? #171

Open
danawoodman opened this issue Mar 4, 2018 · 5 comments
Open

Environment config support? #171

danawoodman opened this issue Mar 4, 2018 · 5 comments

Comments

@danawoodman
Copy link

I am trying to use environment configs to allow me to develop, test and deploy to my Tessel without hardcoding API keys etc.

I have attempted to use node-config as well as dotenv and while both work great in my Jest test suite and in development, the configs don't work on the Tessel. I have added my .env file to .tesselinclude and triple checked everything but nothing is working.

Are environment configs support on Tessel's VM/OS? If so, what am I missing?

Thanks!

@danawoodman
Copy link
Author

@Frijol @HipsterBrown any suggestions?

@rwaldron
Copy link
Contributor

rwaldron commented Mar 9, 2018

I've never tried deploying with a .env file, but my guess is that dotenv is looking in the wrong place: https://github.com/motdotla/dotenv#path, try this:

require('dotenv').config({path: path.join(__dirname, '.env')});

@danawoodman
Copy link
Author

@rwaldron thanks I'll give this a shot and report back!

@ivan-marquez
Copy link

Hi @danawoodman! Did you manage to make it work by specifying the path with __dirname? I'm stuck with the same issue. Thanks!

@ivan-marquez
Copy link

ok just to confirm, specifying the path works. 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

3 participants