Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created April 16, 2019 02:14
Show Gist options
  • Save dcomartin/305e74b9760033cfeaa4db16cb06a4f6 to your computer and use it in GitHub Desktop.
Save dcomartin/305e74b9760033cfeaa4db16cb06a4f6 to your computer and use it in GitHub Desktop.
using Amazon.S3;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace AspNetCore.Aws.Demo
{
public class Startup
{
private readonly IConfiguration _configuration;
public Startup(IConfiguration configuration)
{
_configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddDefaultAWSOptions(_configuration.GetAWSOptions());
services.AddAWSService<IAmazonS3>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment