Skip to content

Conversation

dromie
Copy link

@dromie dromie commented Jun 4, 2020

Either in config file, which can be overridden by PUBLISH_URL environment variable
Useful if you are running crates-mirror in a container.

@@ -295,7 +296,8 @@ fn main() {
if !base_dir.exists() {
create_dir_all(base_dir.clone()).unwrap();
}
let url: &str = &config.listen_on.clone();
let url: &str = &std::env::var("PUBLISH_URL").unwrap_or(config.publish_url.clone());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use the dotenv crate here instead.

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.

2 participants