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

How to deal with dependencies that rely on System environment variables? #102

Open
Francesco-Lanciana opened this issue Oct 9, 2020 · 1 comment

Comments

@Francesco-Lanciana
Copy link

I'm currently using the Goth library which on start relies on a system environment variable having been set. From my understanding mix is responsible for starting dependencies before the main application starts, which is where we use Vapor to load in environment variables.

Is there any way to deal with this situation nicely? i.e. use vapor to load environment variables before the application is started?
I'm also curious to know, in general should library authors not be using System.get_env? Is this more a case of a poorly thought out library or is it just a limitation of Vapor?

@mhanberg
Copy link
Member

I'm not sure there is a way.

In your case, according to the readme, Goth allows you to a config module with an init callback, which should work with vapor.

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