Skip to content

Commit 2d0b287

Browse files
committed
chore: add Web Cors Configuration
1 parent 0e61e76 commit 2d0b287

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.climbup.climbup.global.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
5+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6+
7+
@Configuration
8+
public class WebConfig implements WebMvcConfigurer {
9+
@Override
10+
public void addCorsMappings(CorsRegistry registry) {
11+
registry.addMapping("/**")
12+
.allowedOrigins("http://localhost:5173", "https://holdy.kr")
13+
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
14+
.allowedHeaders("*")
15+
.allowCredentials(true);
16+
}
17+
}

0 commit comments

Comments
 (0)