I\'m trying to create an application that has front-end and back-end assets separated. For the sake of example, let\'s say that front-end side will eventually be hosted on g
If you are using Spring-Boot you can do this in your spring configuration:
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("http://localhost:8080", "http://127.0.0.1:8080");
}
};
}