42 lines
968 B
C#
42 lines
968 B
C#
using AppLibs.Libs;
|
|
|
|
WSNavigation.LoadJson();
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
#if (!DEBUG)
|
|
builder.WebHost.UseKestrel(o =>
|
|
{
|
|
o.ListenAnyIP(5103, lo =>
|
|
{
|
|
lo.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
|
|
lo.UseHttps(CertificateStore.GetHTTPSCertificate("MApp.pfx"), "Pgq95b7r");
|
|
});
|
|
});
|
|
builder.Services.AddControllersWithViews();
|
|
#else
|
|
builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();
|
|
#endif
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Home/Error");
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
app.UseHsts();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseStaticFiles();
|
|
|
|
app.UseRouting();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllerRoute(
|
|
name: "default",
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
|
|
|
app.Run();
|