Answer the question
In order to leave comments, you need to log in
Why should I enable cross-site request support in Spring boot & Angular?
When developing a project with Spring and Angular, I must add the @CrossOrigin annotation to Spring controllers to enable CORS support.
A-priory
Cross-origin resource sharing is a modern browser technology that allows web pages to access resources from another domain.
Note: Even if your backend server is running on localhost with a different port, it is treated as a different domain.
Answer the question
In order to leave comments, you need to log in
Use cross-origin for development.
In prod. environment, you will have some kind of http server (nginx, for example), which will solve all these issues
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question