Setting up Kestrel
As we did in the first two chapters of this book, we need to override the default WebHostBuilder a little bit to set up Kestrel. With ASP.NET Core 3.0 and later, it is possible to replace the default Kestrel base configuration with a custom configuration. This means that the Kestrel web server is configured to the host builder. Let's look at the steps to set up:
- You will be able to add and configure Kestrel manually simply by using it. The following code shows what happens when you call the
UseKestrel()method onIwebHostBuilder. Let's now see how this fits into theCreateWebHostBuildermethod:public class Program { public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => &...