Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            var config = new ConfigurationBuilder()
                         .SetBasePath(Directory.GetCurrentDirectory())
                         .AddJsonFile("appsettings.json", optional: false)
                         .Build();

            _hangfireConfig = config.GetSection("hangfireConfig").Get <HangfireServiceConfigBE>();

            CreateHostBuilder(args).Build().Run();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var config = new ConfigurationBuilder()
                         .SetBasePath(Directory.GetCurrentDirectory())
                         .AddJsonFile("appsettings.json", optional: false)
                         .Build();

            // Load config sections
            _hangfireConfig = config.GetSection("hangfireConfig").Get <HangfireServiceConfigBE>();

            CreateHostBuilder(args).Build().Run();
        }
Ejemplo n.º 3
0
        private static string[] BuildURLs(HangfireServiceConfigBE hangfireConfig)
        {
            var urls = new List <string>();

            string protocol = hangfireConfig.IsUseSSL ? @"https" : "http";

            urls.Add($"{protocol}://localhost:{hangfireConfig.DashboardPortNumber}");

            if (hangfireConfig.IsDashboardRemoteAccessEnabled)
            {
                urls.Add($"{protocol}://{Environment.MachineName}:{hangfireConfig.DashboardPortNumber}");
            }

            return(urls.ToArray());
        }