I am a Java programmer learning C# on the job and I have inherited a command line application in .NET which sets up Kestrel to provide endpoints to a frontend.
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
private static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
I would like to be able to programmatically verify in our build pipeline that the application exposes an exact list of endpoints. For now the relative path of the URL's will be enough.
What would be the best way to approach this? Look into the HostBuilder created, or by asking the runtime when fully started?