Krishna0718's picture
Adding file for new hugging face docker space
bb5169d
raw
history blame
976 Bytes
package com.krishna.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 WebConfig {
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins(
"http://127.0.0.1:5500",
"http://localhost:5173",
"https://my-media-718.netlify.app"
)
.allowedMethods("*")
.allowedHeaders("*")
.allowCredentials(true);
}
};
}
}