Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

cors spring method or class

public WebMvcConfigurer corsConfigurer() {
		return new WebMvcConfigurer() {
			@Override
			public void addCorsMappings(CorsRegistry registry) {
				registry.addMapping("/greeting-javaconfig").allowedOrigins("http://localhost:8080");
			}
		};
	}COPY
Source by spring.io #
 
PREVIOUS NEXT
Tagged: #cors #spring #method #class
ADD COMMENT
Topic
Name
3+6 =