config: Allow all origins in CORS policy and disable HTTPS redirection.
Build & Push Hospitality / build-and-push (push) Failing after 2m4s
Build & Push Hospitality / build-and-push (push) Failing after 2m4s
This commit is contained in:
@@ -65,17 +65,10 @@ builder.Services.AddScoped<ITransactionService, TransactionService>();
|
|||||||
// Add CORS
|
// Add CORS
|
||||||
builder.Services.AddCors(options =>
|
builder.Services.AddCors(options =>
|
||||||
{
|
{
|
||||||
options.AddPolicy("AllowFrontend", policy =>
|
policy.SetIsOriginAllowed(origin => true) // Allow any origin
|
||||||
{
|
|
||||||
policy.WithOrigins(
|
|
||||||
"http://localhost:5173",
|
|
||||||
"https://hospitality-dev.theriise.net",
|
|
||||||
"https://hospitality.theriise.net"
|
|
||||||
)
|
|
||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.AllowAnyMethod();
|
.AllowAnyMethod();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
@@ -101,7 +94,7 @@ if (app.Environment.IsDevelopment())
|
|||||||
app.UseSwaggerUI();
|
app.UseSwaggerUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
// app.UseHttpsRedirection(); // Disabled because Traefik handles SSL
|
||||||
|
|
||||||
app.UseCors("AllowFrontend");
|
app.UseCors("AllowFrontend");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user