Files
CipherStreamAPI/src/main/java/com/mattrixwv/cipherstream/config/WebConfig.java
2026-01-06 23:48:37 -05:00

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);
}
}