mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-06 14:53:47 +00:00
Initial commit
This commit is contained in:
parent
f7cc057037
commit
f2066234b0
18 changed files with 98 additions and 18 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue