Compare commits

...

3 Commits

Author SHA1 Message Date
steinhelge c3750239c7 feat: configure Traefik load balancer for hospitality-dev-api to use port 8080
Build & Push Hospitality / build-and-push (push) Failing after 3m8s
2025-11-26 12:33:18 +01:00
steinhelge d1568c788a config: Allow all origins in CORS policy and disable HTTPS redirection.
Build & Push Hospitality / build-and-push (push) Failing after 2m4s
2025-11-26 12:07:31 +01:00
steinhelge dcc8e10bd2 config: Expand CORS policy to include development and production frontend URLs.
Build & Push Hospitality / build-and-push (push) Successful in 3m5s
2025-11-26 11:48:38 +01:00
2 changed files with 3 additions and 5 deletions
+2 -5
View File
@@ -65,12 +65,9 @@ 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")
.AllowAnyHeader() .AllowAnyHeader()
.AllowAnyMethod(); .AllowAnyMethod();
});
}); });
@@ -97,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");
@@ -39,6 +39,7 @@ services:
- "traefik.http.routers.hospitality-dev-api.rule=Host(`hospitality-dev-api.theriise.net`)" - "traefik.http.routers.hospitality-dev-api.rule=Host(`hospitality-dev-api.theriise.net`)"
- "traefik.http.routers.hospitality-dev-api.entrypoints=websecure" - "traefik.http.routers.hospitality-dev-api.entrypoints=websecure"
- "traefik.http.routers.hospitality-dev-api.tls=true" - "traefik.http.routers.hospitality-dev-api.tls=true"
- "traefik.http.services.hospitality-dev-api.loadbalancer.server.port=8080"
web: web:
image: gitea.theriise.net/steinhelge/hospitality-frontend:dev image: gitea.theriise.net/steinhelge/hospitality-frontend:dev