diff --git a/src/main/java/com/spaceclub/global/config/WebConfig.java b/src/main/java/com/spaceclub/global/config/WebConfig.java new file mode 100644 index 00000000..976fe79f --- /dev/null +++ b/src/main/java/com/spaceclub/global/config/WebConfig.java @@ -0,0 +1,18 @@ +package com.spaceclub.global.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedMethods("*") + .allowCredentials(true) + .maxAge(1800); // 1800초, 30분으로 설정 + } + +}