feat: 프론트엔드 분리로 인한 CORS 설정 추가

This commit is contained in:
이상진 2025-07-27 11:52:43 +09:00
parent ede2e7f624
commit 98e2e69ffa

View File

@ -0,0 +1,16 @@
package roomescape.common.config
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration
class CorsConfig : WebMvcConfigurer {
override fun addCorsMappings(registry: CorsRegistry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:5173")
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")
.allowedHeaders("Authorization", "Content-Type")
.maxAge(3600) // 1 hour
}
}