feat: add CORS configuration for backend API
This commit is contained in:
parent
b803055307
commit
042f1db9f8
1 changed files with 15 additions and 0 deletions
15
backend/src/main/java/de/szut/casino/config/CorsConfig.java
Normal file
15
backend/src/main/java/de/szut/casino/config/CorsConfig.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package de.szut.casino.config;
|
||||
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
public class CorsConfig implements WebMvcConfigurer {
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("http://localhost:4200", "http://192.168.176.120:4200")
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||
.allowedHeaders("*")
|
||||
.allowCredentials(true)
|
||||
.maxAge(3600);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue