Ejemplo n.º 1
0
        private void RegisterService(string name, int port, string route)
        {
            var options = Options.Create(new ServiceManagerConfig
            {
                ServiceName = name,
                ServicePort = port
            });

            var serviceManager = new ServiceManager(options);

            var ignore = serviceManager
                         .AddHttpHealthCheck(HealthRoute, 1)
                         .AddApiUrl(route)
                         .RegisterServiceAsync();
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            var serviceManager = new ServiceManager("TestService", "localhost", 8500);

            serviceManager.AddHttpHealthCheck("/Health", 10)
            .AddApiUrl("/testsample/test3/test2")
            .AddApiUrl("/testSample/test3/test1")
            .RegisterServiceAsync().Wait();

            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseUrls($"http://*:{serviceManager.ServicePort}")
                       .UseStartup <Startup>()
                       .Build();

            host.Run();
        }
Ejemplo n.º 3
0
        public static void Main(string[] args)
        {
            var serviceManager = new ServiceManager("TestService");

            serviceManager.AddHttpHealthCheck("health", 10)
            .AddApiUrl("/api/someObject")
            .AddApiUrl("/api/someOtherObject")
            .RegisterServiceAsync().Wait();

            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseUrls($"http://*:{serviceManager.ServicePort}")
                       .UseStartup <Startup>()
                       .Build();

            host.Run();
        }