private static async Task RunLighthouse(LighthouseCliOptions opts) { var hostBuilder = new HostBuilder().ConfigureServices((hostContext, services) => { services.AddSingleton <IHostedService, LighthouseService>( provider => new LighthouseService(opts.ClusterNodeHostname, opts.ClusterNodePort)); }); await hostBuilder.RunConsoleAsync().ConfigureAwait(false); }
private static async Task Main(String[] args) { LighthouseCliOptions cliOptions = null; Parser.Default.ParseArguments <LighthouseCliOptions>(args).WithParsed(options => cliOptions = options); if (cliOptions == null) { return; } await RunLighthouse(cliOptions).ConfigureAwait(false); }