WebConfig.java 514 B

123456789101112131415
  1. package es.uv.garcosda.config;
  2. import org.springframework.context.annotation.Configuration;
  3. import org.springframework.web.servlet.config.annotation.CorsRegistry;
  4. import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  5. @Configuration
  6. public class WebConfig implements WebMvcConfigurer {
  7. @Override
  8. public void addCorsMappings(CorsRegistry registry) {
  9. registry.addMapping("/**").allowedOrigins("*")
  10. .allowedMethods("*").allowedHeaders("*")
  11. .allowCredentials(false).maxAge(3600);
  12. }
  13. }