public static void Start(IMicroserviceConfiguration config) { if (config == null) { throw new ArgumentNullException("config"); } var bootstrapper = new Bootstrapper(config); var hostConfig = new HostConfiguration { UrlReservations = new UrlReservations { CreateAutomatically = true }, }; var uri = new Uri("http://localhost:" + config.Port); using (var host = new NancyHost(bootstrapper, hostConfig, uri)) { host.Start(); Console.WriteLine("{0} is running on {1}", config.Name, uri); Console.WriteLine("Press any [Enter] to close the host."); WaitForTerminator(); } }
public Bootstrapper(IMicroserviceConfiguration config) : base() { StaticConfiguration.DisableErrorTraces = false; _config = config; }