24 lines
653 B
Java
24 lines
653 B
Java
package com.mattrixwv.cipherstream.config;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
|
@Component
|
|
@EnableWebMvc
|
|
public class WebConfig implements WebMvcConfigurer{
|
|
@Value("${allowedOrigins}")
|
|
private String allowedOrigins;
|
|
|
|
|
|
@Override
|
|
public void addCorsMappings(CorsRegistry registry){
|
|
registry.addMapping("/**")
|
|
.allowedOriginPatterns(allowedOrigins);
|
|
}
|
|
}
|