feat: Broaden backend CORS mapping to all paths and update frontend API base URL to production.
All checks were successful
Build and Push Docker Images / build-and-push (push) Successful in 3m51s

This commit is contained in:
almazlar
2026-02-21 00:02:28 +03:00
parent 568f6627ba
commit ca838b17a5
2 changed files with 4 additions and 3 deletions

View File

@@ -9,8 +9,9 @@ public class WebConfig implements WebMvcConfigurer {
@Override @Override
public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/**") registry.addMapping("/**")
.allowedOrigins("http://localhost:5173", "http://localhost:3000", "http://localhost:8081", "http://localhost:80") // Typical Vite/React/Docker ports .allowedOrigins("http://localhost:5173", "http://localhost:3000", "http://localhost:8081",
"http://localhost:80") // Typical Vite/React/Docker ports
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*") .allowedHeaders("*")
.allowCredentials(true); .allowCredentials(true);

View File

@@ -1,4 +1,4 @@
const BASE_URL = 'http://localhost:8082/api/todos'; const BASE_URL = 'https://todo.almazlar.com/api/todos';
export const getTodos = async () => { export const getTodos = async () => {
const response = await fetch(BASE_URL); const response = await fetch(BASE_URL);