Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 35aca39

Browse files
committed
added RestConfiguration to fix cors issues.
1 parent 25a79bb commit 35aca39

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package de.filefighter.rest.config;
2+
3+
import org.jetbrains.annotations.NotNull;
4+
import org.springframework.context.annotation.Bean;
5+
import org.springframework.context.annotation.Configuration;
6+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
7+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
8+
9+
@Configuration
10+
public class RestConfiguration {
11+
12+
@Bean
13+
public WebMvcConfigurer configurer(){
14+
15+
return new WebMvcConfigurer(){
16+
@Override
17+
public void addCorsMappings(@NotNull CorsRegistry registry) {
18+
registry.addMapping("/*")
19+
.allowedOrigins("*");
20+
}
21+
};
22+
}
23+
}

0 commit comments

Comments
 (0)