Prvi commit
This commit is contained in:
55
EveryThing/Program.cs
Normal file
55
EveryThing/Program.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Threading.Tasks;
|
||||
using NLog;
|
||||
using NLog.Web;
|
||||
|
||||
namespace EveryThing
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
//var logger = NLog.LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||
//logger.Debug("INIT");
|
||||
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(
|
||||
webBuilder =>
|
||||
{
|
||||
webBuilder.ConfigureLogging(logging =>
|
||||
{
|
||||
logging.ClearProviders();
|
||||
logging.AddConsole();
|
||||
}).UseNLog();
|
||||
|
||||
#if !DEBUG
|
||||
webBuilder.UseKestrel(opts =>
|
||||
{
|
||||
var appServices = opts.ApplicationServices;
|
||||
//opts.Listen(IPAddress.Parse("192.168.1.150"), 80);
|
||||
//opts.Listen(IPAddress.Parse("192.168.1.150"), 443, o => o.UseHttps(h => { h.UseLettuceEncrypt(appServices); }));
|
||||
|
||||
//opts.Listen(IPAddress.Parse("192.168.111.77"), 5005);
|
||||
opts.Listen(IPAddress.Parse("192.168.178.205"), 5005);//novi server
|
||||
opts.Listen(IPAddress.Loopback, port: 8081);
|
||||
//opts.ListenLocalhost(4433, opts => opts.UseHttps());
|
||||
opts.ListenLocalhost(5005);
|
||||
//opts.ListenLocalhost(5005, opts => opts.UseHttps());
|
||||
});
|
||||
#endif
|
||||
webBuilder.UseContentRoot(Directory.GetCurrentDirectory());
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user