This commit is contained in:
Maciej Maciejewski 2025-01-04 23:12:55 +01:00
parent b21c9fa149
commit da508f3015

View File

@ -38,6 +38,7 @@ using FirmTracker_Server.Services;
using System.Reflection; using System.Reflection;
using FirmTracker_Server.Mappings; using FirmTracker_Server.Mappings;
using NuGet.Packaging; using NuGet.Packaging;
using Microsoft.AspNetCore.DataProtection;
@ -72,7 +73,7 @@ namespace FirmTracker_Server
TestClass test = new TestClass(); TestClass test = new TestClass();
test.AddTestProduct(); test.AddTestProduct();
QuestPDF.Settings.License = QuestPDF.Infrastructure.LicenseType.Community; QuestPDF.Settings.License = QuestPDF.Infrastructure.LicenseType.Community;
builder.Services.AddDataProtection().DisableAutomaticKeyGeneration();
builder.Services.AddCors(options => builder.Services.AddCors(options =>
{ {
options.AddPolicy("AllowSpecificOrigin", options.AddPolicy("AllowSpecificOrigin",
@ -106,9 +107,9 @@ namespace FirmTracker_Server
var port = configSwagger.GetValue<int>("Port", 5075); var port = configSwagger.GetValue<int>("Port", 5075);
var port2 = configSwagger.GetValue<int>("Port", 7039); // var port2 = configSwagger.GetValue<int>("Port", 7039);
app.Urls.Add($"http://*:{port}"); app.Urls.Add($"http://*:{port}");
app.Urls.Add($"https://*:{port2}"); // app.Urls.Add($"https://*:{port2}");
try try
{ {
@ -119,14 +120,14 @@ namespace FirmTracker_Server
c.RoutePrefix = "swagger"; c.RoutePrefix = "swagger";
}); });
Console.WriteLine("uruchomiono swaggera"); Console.WriteLine("uruchomiono swaggera");
app.UseHttpsRedirection(); // app.UseHttpsRedirection();
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine("Nie uda³o siê uruchomiæ swaggera"); Console.WriteLine("Nie uda³o siê uruchomiæ swaggera");
} }
app.UseHttpsRedirection(); // app.UseHttpsRedirection();
app.UseCors("AllowSpecificOrigin"); app.UseCors("AllowSpecificOrigin");