mirror of
https://github.com/XFox111/MuiCharts.git
synced 2026-04-22 06:51:05 +03:00
- Added CORS
- Fixed backed Dockerfile to have /persistence if volume is not attached
This commit is contained in:
@@ -21,6 +21,17 @@ WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.AddInfrastructure();
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddDefaultPolicy(policy =>
|
||||
{
|
||||
policy
|
||||
.WithOrigins(builder.Configuration.GetValue<string[]>("Cors:Origins") ?? ["*"])
|
||||
.WithMethods(builder.Configuration.GetValue<string[]>("Cors:Methods") ?? ["*"])
|
||||
.AllowAnyHeader();
|
||||
});
|
||||
});
|
||||
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen(options =>
|
||||
{
|
||||
@@ -46,6 +57,8 @@ WebApplication app = builder.Build();
|
||||
if (app.Configuration.GetSection("LettuceEncrypt").Exists())
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseCors();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user