How to Fix CORS Error in SpringBoot and React

preview_player
Показать описание
Thanks for watching the video:

My Gadgets:

We will see how to fix CORS Error in Springboot and React JS.

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

}

Hope it will fix your problem too.
Рекомендации по теме
Комментарии
Автор

2 years later youre still helping people out bro, thank you!

nathaniellane
Автор

thank you so much, i struggled a lot between thousand of video and pdf and i confirm you are the simpliest and the most realistic ; well done and bless you;

arbibenmaatoug
Автор

You are the life saver, simple solution made my application work...Thank you soo much!

madhulisuvarnakar
Автор

This worked so well bro, thanks a lot.

sharathlingam
Автор

thanks bro i struggled a lot in between many times once again thanks 👍👍👍

nagararun
Автор

Wonderful explanation bro, keep it up.👍

wrgcvom
Автор

YOU HAVE NO IDEA HOW FRUSTRATING TO SEE THIS ERROR DUDE, SUPPERRR THANKSS KIND SAMARITAN <3333

Psychopatz
Автор

i used this annotation but still getting same error in react .

JohnDoe-ejvm
Автор

Thank you my friend . I really need this solution

MrRider-kwmq
Автор

Thank you so much it was really helpful ❤

farzanfarooqui
Автор

But this is not a fix! this is a security issue as you basically have disabled all the CORS protection based on the origin!
Very dangerous to put this in production!

GeorgeDumitra
Автор

Thanks so much for the video, but please address pitfalls of this approach in production too, because it is not valid solution to allow all requests by just putting "*" 🙄

asadkhandadlo
Автор

Doesnt work for me, but im black so it might have to do with that😊

kristiansdanilovs
Автор

and it's not shlas... it is SLASHHH

alfonsopayra