fix: logs in admin panel

This commit is contained in:
2024-12-18 14:00:05 +01:00
parent 967518dc71
commit 0a89b6ade1
2 changed files with 10 additions and 1 deletions

View File

@ -33,6 +33,14 @@ builder.Services.AddDbContext<DataContext>(options =>
options.UseNpgsql(dataSource);
});
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
{
policy.WithOrigins("http://localhost:5192");
});
});
var app = builder.Build();
// Initialize database
@ -48,6 +56,7 @@ if (app.Environment.IsDevelopment())
var scope = app.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<DataContext>();
app.UseCors();
app.MapControllers();
var mode = Environment.GetEnvironmentVariable("WORKMODE");