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

Publish url can be set #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Publish url can be set #6

wants to merge 1 commit into from

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