generated from pricelees/issue-pr-template
feat: 프론트엔드 분리로 인한 CORS 설정 추가
This commit is contained in:
parent
ede2e7f624
commit
98e2e69ffa
16
src/main/kotlin/roomescape/common/config/CorsConfig.kt
Normal file
16
src/main/kotlin/roomescape/common/config/CorsConfig.kt
Normal 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
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user