protected override void OnStart(string[] args) { base.OnStart(args); startup = new SelfHostStartup(settings); var options = new StartOptions(); if (!string.IsNullOrWhiteSpace(settings.ServerFactory)) { options.ServerFactory = settings.ServerFactory; Log.Info(m => m("Using ServerFactory {0}", options.ServerFactory)); } ; var urls = settings.Urls.ToArray(); if (urls.Any()) { options.Urls.AddRange(urls); } else { options.Port = settings.Port; urls = new[] { "http://*:" + options.Port + "/" }; } server = WebApp.Start(options, startup.Configuration); Log.Info(m => m("Listening for HTTP requests on address(es): {0}", string.Join(", ", urls))); }
protected override void OnStart(string[] args) { base.OnStart(args); startup = new SelfHostStartup(settings); var options = new StartOptions(); if (!string.IsNullOrWhiteSpace(settings.ServerFactory)) { options.ServerFactory = settings.ServerFactory; Log.Info(m => m("Using ServerFactory {0}", options.ServerFactory)); }; var urls = settings.Urls.ToArray(); if (urls.Any()) { options.Urls.AddRange(urls); } else { options.Port = settings.Port; urls = new[] {"http://*:" + options.Port + "/"}; } server = WebApp.Start(options, startup.Configuration); Log.Info(m => m("Listening for HTTP requests on address(es): {0}", string.Join(", ", urls))); }