Created
February 8, 2018 09:35
-
-
Save ruan65/8b84a46d086eeedc06c0a26483b0a4ed to your computer and use it in GitHub Desktop.
Controller method CORS configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if localhost do not forget add http:// before url | |
package ru.redsys.event_manager_rea.configuration; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.web.servlet.config.annotation.CorsRegistry; | |
import org.springframework.web.servlet.config.annotation.EnableWebMvc; | |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | |
@Configuration | |
@EnableWebMvc | |
public class WebConfig extends WebMvcConfigurerAdapter { | |
@Override | |
public void addCorsMappings(CorsRegistry registry) { | |
registry.addMapping("/**"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment