Рет қаралды 22,274
Thanks for watching the video:
Subscribe Channel: / studyautomation1
My Gadgets:
MIC:- amzn.to/3UQPlaF
Camera:- amzn.to/3WYszQ3
Laptop:- amzn.to/3EsPzzt Hi Everyone, in this video, I am going to Fix one of the major errors while working with SpringBoot Project.
We will see how to fix CORS Error in Springboot and React JS.
You can create spring boot project using: start.spring.io/
Here is my code, add this code in Main Class of Springboot project:
@Bean
public WebMvcConfigurer configure() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry reg) {
reg.addMapping("/**").allowedOrigins("*");
}
};
}
Hope it will fix your problem too.