concept Startup class in category c#

appears as: Startup class
Code like a Pro in C#

This is an excerpt from Manning's book Code like a Pro in C#.

Figure 5.8 In this section we create an instance of WebHostBuilder, set a startup URL, and build the WebHost instance. This code uses the builder pattern, explained in section 5.2.2.

How does this impact our Main method? Not much. All we have to do is call the InitializeWebHost method and pass in the command line arguments.

using System;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace FlyingDutchmanAirlines
{
   class Program
    {
        static void Main(string[] args)
        {
            InitializeWebHost(args);
        }
    
    private static void InitializeWebHost(string[] args) => ➥WebHost.CreateDefaultBuilder(args).UseUrls("http://0.0.0.0:8080 ")
➥.Build().Run();
  }
}