Skip to content

Commit 3f9ab46

Browse files
Add support for local s3 endpoint
Fallback is always AWS, but this allows easy use of minio and the like for local development.
1 parent acd2833 commit 3f9ab46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/db/file.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ fn s3_client() -> S3Client {
9696
let client = S3Client::new_with(
9797
rusoto_core::request::HttpClient::new().unwrap(),
9898
EnvironmentProvider::default(),
99-
Region::UsWest1,
99+
std::env::var("S3_ENDPOINT").ok().map(|e| Region::Custom {
100+
name: "us-west-1".to_owned(),
101+
endpoint: e,
102+
}).unwrap_or(Region::UsWest1),
100103
);
101104
client
102105
}

0 commit comments

Comments
 (0)