generated from pricelees/issue-pr-template
[#28] 쿠버네티스 환경 배포 #29
@ -1,14 +1,19 @@
|
||||
package roomescape.common.config
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
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 {
|
||||
|
||||
@Value("\${cors-origin}")
|
||||
private lateinit var origin: String
|
||||
|
||||
override fun addCorsMappings(registry: CorsRegistry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("http://localhost:5173")
|
||||
.allowedOrigins(origin)
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")
|
||||
.allowedHeaders("Authorization", "Content-Type")
|
||||
.maxAge(3600) // 1 hour
|
||||
|
||||
@ -37,3 +37,5 @@ management:
|
||||
tracing:
|
||||
transport: ${OTLP_TRACING_PROTOCOL}
|
||||
endpoint: ${OTLP_TRACING_ENDPOINT}
|
||||
|
||||
cors-origin: ${CORS_ORIGIN}
|
||||
@ -44,4 +44,6 @@ jdbc:
|
||||
management:
|
||||
tracing:
|
||||
sampling:
|
||||
probability: 1
|
||||
probability: 1
|
||||
|
||||
cors-origin: "http://localhost:5173"
|
||||
Loading…
x
Reference in New Issue
Block a user