private Task StartWebMode(WebOptions options) { var config = new LocalWebServerConfig { Port = options.Port }; var tokenSource = new CancellationTokenSource(); var token = new CancellationToken(); /*var task = */ _localWebServer.RunAsync(config, token); UtilConsole.WriteSuccess("Local server started. Press <Enter> to stop..."); if (options.OpenWindow) { var url = $"http://localhost:{config.Port}"; UtilSystem.OpenUrl(url); } Console.ReadLine(); Console.WriteLine("Stopping local server..."); _localWebServer.Stop(); tokenSource.Cancel(); return(Task.CompletedTask); }
public void WriteSuccess(string input) { UtilConsole.WriteSuccess(input); }