Initial commit

This commit is contained in:
Mark J Price 2022-03-15 11:01:57 +00:00
parent f7cc057037
commit f2066234b0
18 changed files with 98 additions and 18 deletions

View file

@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc.Formatters; // IOutputFormatter, OutputFormatter
using Packt.Shared; // AddNorthwindContext extension method
using Northwind.WebApi.Repositories; // ICustomerRepository, CustomerRepository
using Swashbuckle.AspNetCore.SwaggerUI;
using Microsoft.AspNetCore.Server.Kestrel.Core; // HttpProtocols
var builder = WebApplication.CreateBuilder(args);
@ -39,6 +40,15 @@ builder.Services.AddScoped<ICustomerRepository, CustomerRepository>();
builder.Services.AddHealthChecks()
.AddDbContextCheck<NorthwindContext>();
builder.WebHost.ConfigureKestrel((context, options) =>
{
options.ListenAnyIP(5002, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
listenOptions.UseHttps(); // HTTP/3 requires secure connections
});
});
var app = builder.Build();
// Configure the HTTP request pipeline.