Пример #1
0
        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();
            }
        }
Пример #2
0
 public Bootstrapper(IMicroserviceConfiguration config) : base()
 {
     StaticConfiguration.DisableErrorTraces = false;
     _config = config;
 }