Skip to content
Snippets Groups Projects
Commit 15f363ca authored by migudel's avatar migudel :speech_balloon:
Browse files

prueba de cors

parent e80ebba4
Branches
Tags
1 merge request!26Revert "Funciona register"
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment