Created
September 24, 2020 05:20
-
-
Save staff0rd/daeb079a10a69d9a4f7c2ca379b9f1c3 to your computer and use it in GitHub Desktop.
local-amazon-s3-04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services | |
.AddSingleton<IAmazonS3>(p => { | |
var config = new AmazonS3Config | |
{ | |
RegionEndpoint = RegionEndpoint.USWest2, | |
}; | |
if (p.GetService<IHostEnvironment>().IsDevelopment()) | |
{ | |
config.ForcePathStyle = true; | |
config.ServiceURL = options.Url; | |
} | |
return new AmazonS3Client(myAccessKey, mySecret, config); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment