From bc54b3dc35a5361f000c5b0e4becc5c5dac2b01a Mon Sep 17 00:00:00 2001 From: migudel <miguel.moras@estudiantes.uva.es> Date: Sun, 1 Dec 2024 18:12:16 +0100 Subject: [PATCH] Cambio a entorno de desarrollo angular --- .../src/environments/environment.prod.ts | 15 ++++++++++++--- .../uva/authentication/config/CorsConfig.java | 19 ------------------- 2 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 java/services/auth/src/main/java/com/uva/authentication/config/CorsConfig.java diff --git a/angular/RestClient/src/environments/environment.prod.ts b/angular/RestClient/src/environments/environment.prod.ts index 9428853..4449314 100644 --- a/angular/RestClient/src/environments/environment.prod.ts +++ b/angular/RestClient/src/environments/environment.prod.ts @@ -1,8 +1,17 @@ -const monolithUrl = 'http://rooms-booking-api:8080'; +// const monolithUrl = 'http://rooms-booking-api:8080'; + +// export const environment = { +// production: true, +// authAPI: 'http://auth-api:8101', +// userAPI: `http://${monolithUrl}/users`, +// hotelAPI: `http://${monolithUrl}/hotels`, +// bookingAPI: `http://${monolithUrl}/bookings`, +// }; +const monolithUrl = 'localhost:8080'; export const environment = { - production: true, - authAPI: 'http://auth-api:8101', + production: false, + authAPI: 'http://localhost:8101', userAPI: `http://${monolithUrl}/users`, hotelAPI: `http://${monolithUrl}/hotels`, bookingAPI: `http://${monolithUrl}/bookings`, diff --git a/java/services/auth/src/main/java/com/uva/authentication/config/CorsConfig.java b/java/services/auth/src/main/java/com/uva/authentication/config/CorsConfig.java deleted file mode 100644 index ed09601..0000000 --- a/java/services/auth/src/main/java/com/uva/authentication/config/CorsConfig.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.uva.authentication.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@Configuration -public class CorsConfig implements WebMvcConfigurer { - - @Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") // Permitir acceso a todos los endpoints - .allowedOrigins("http://localhost:4200") // Origen del frontend - .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") - .allowedHeaders("*") - .allowCredentials(true); - } -} \ No newline at end of file -- GitLab