Skip to content

Instantly share code, notes, and snippets.

@staff0rd
Created September 24, 2020 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staff0rd/daeb079a10a69d9a4f7c2ca379b9f1c3 to your computer and use it in GitHub Desktop.
Save staff0rd/daeb079a10a69d9a4f7c2ca379b9f1c3 to your computer and use it in GitHub Desktop.
local-amazon-s3-04
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