Back to Browse

How to Fix CORS Error in SpringBoot and React

24.1K views
Nov 28, 2021
22:11

Thanks for watching the video: Subscribe Channel: https://youtube.com/c/StudyAutomation1 My Gadgets: MIC:- https://amzn.to/3UQPlaF Camera:- https://amzn.to/3WYszQ3 Laptop:- https://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: https://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.

Download

0 formats

No download links available.

How to Fix CORS Error in SpringBoot and React | NatokHD